Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82040

Retain fixed column width after altering column visibility?

$
0
0
Hello there,

I'm trying to achieve something which should be rather simple and straightforward, but I have spent way too much time on it that I've decided to ask here.

Namely, I have a table with variable column count, but fixed column width (table-layout: fixed;).
Upon the first render, the table renders as it should (respecting the column widths), but the moment I call fnSetColumnVis to hide a column, column widths are recalculated to fill the old table width, even though it should be the other way around (table width recalculated to match the new column count * column width).

To put it more graphically, imagine I've got a table with 2 columns, 100px width each.
Upon first render: table width = 200px, containing 2 columns of 100px width each.
Now let's call fnSetColumnVis(0, false), we get: table width = 200px, containing 1 column of 200px width
while expected is: table width = 100px, containing 1 column of 100px width

You can gather more info about my curent (work in progress) setup from the debugger: ayiwej

Thanks!

Viewing all articles
Browse latest Browse all 82040

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>