Bootstrap Table - resizable via header
Bootstrap Table - resizable via header. Answer for http://stackoverflow.com/questions/35022314/bootstrap-table-resize-the-column-using-header, where questioned why official example didnt allow it
HTML
<link rel="stylesheet" href="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.css">
<script src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>
<script src="http://issues.wenzhixin.net.cn/bootstrap-table/assets/bootstrap-table/src/extensions/resizable/bootstrap-table-resizable.js"></script>
<script src="https://rawgit.com/wenzhixin/colResizable/master/source/colResizable-1.5.source.js"></script>
<table id="table" data-search="true">
<thead>
<tr>
<th data-field="name" data-sortable="true">Name</th>
<th data-field="stargazers_count" data-sortable="true">Stars</th>
<th data-field="forks_count">Forks</th>
<th data-field="description">Description</th>
</tr>
</thead>
</table>
JavaScript
// Bootstrap Table - resizable via header. Answer for http://stackoverflow.com/questions/35022314/bootstrap-table-resize-the-column-using-header, where questioned why official example didnt allow it
var data = [
{
"name": "bootstrap-table",
"stargazers_count": "526",
"forks_count": "122",
"description": "An extended Bootstrap & table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3) "
},
{
"name": "multiple-select",
"stargazers_count": "288",
"forks_count": "150",
"description": "A jQuery plugin to select multiple elements with checkboxes :)"
},
{
"name": "bootstrap-show-password",
"stargazers_count": "32",
"forks_count": "11",
"description": "Show/hide password plugin for twitter bootstrap."
},
{
"name": "blog",
"stargazers_count": "13",
"forks_count": "4",
"description": "my blog"
},
{
"name": "scutech-redmine",
"stargazers_count": "6",
"forks_count": "3",
"description": "Redmine notification tools for chrome extension."
}
];
$(function () {
$('#table').bootstrapTable({
resizable: true,
headerOnly: true,
data: data
});
});