Resize of columns in bootgrid

user3112954 picture user3112954 · Nov 30, 2014 · Viewed 7.6k times · Source

Since there are more number of columns in my bootgrid so the width of column has been reduced in such a way that data is visible partially. So i was thinking of having a facility of user can drag the column size to increase or decrease, or something like whenever user hover the column values and header the data should be visible as a tooltip.. Could you please whether this functionality is possible in bootgrid?

Answer

Storm picture Storm · Sep 2, 2015

Use the data-header-css-class attribute on the desired column and set it to your custom class having the desired width :)

<style>
.cgb-header-name {
    width: 50%;
}
</style>
...
<th data-column-id="name" data-header-css-class="cbg-header-name">Name</th>
...

You can also use the data-width attribute and set the value inline

...
<th data-column-id="name" data-width="70%">Name</th>
...