Forcing column widths
Forcing column widths
mikek
Posts: 4Questions: 0Answers: 0
Hi all,
I've been happily using datatables in general but I am having a fair amount of trouble getting my column widths to cooperate.
I have about 50 columns and the resultant table is much wider than the page, which is fine because using the sScrollX allows scrolling as necessary.
However, I want to rigidly specify the width of each column and not have them deviate regardless of the data in the column. This also means it should be possible, in theory, to know the total width of the table ahead of time.
I'm not getting good results though. I supply a width in my aoColumns for every column but at the end of the day the column widths (as returned by Chrome's "Inspect Object" ) are values that have been computed by the javascript and look like width: 227.72727346420288px;
Is there a way to get datatable to set the style for my columns to be just what I asked for? Is it doing this already but I'm not asking correctly? I can supply some code samples if that is helpful, but I thought maybe there is just a configuration option that I have missed.
Thanks!
Mike K.
I've been happily using datatables in general but I am having a fair amount of trouble getting my column widths to cooperate.
I have about 50 columns and the resultant table is much wider than the page, which is fine because using the sScrollX allows scrolling as necessary.
However, I want to rigidly specify the width of each column and not have them deviate regardless of the data in the column. This also means it should be possible, in theory, to know the total width of the table ahead of time.
I'm not getting good results though. I supply a width in my aoColumns for every column but at the end of the day the column widths (as returned by Chrome's "Inspect Object" ) are values that have been computed by the javascript and look like width: 227.72727346420288px;
Is there a way to get datatable to set the style for my columns to be just what I asked for? Is it doing this already but I'm not asking correctly? I can supply some code samples if that is helpful, but I thought maybe there is just a configuration option that I have missed.
Thanks!
Mike K.
This discussion has been closed.