How to control column width?
How to control column width?

I tried using inline style in column header and/or cell in that column, say style="width:100px", or style="width:20%", etc. But it didn't work. Table column width seems to be automatically adjusted based on the length of data in that column. Maybe there is a setting on DataTable I can use?
This discussion has been closed.
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Here is my test case http://live.datatables.net/sapabago/1/
I would like to make column 4 a fixed width or 50%. Column 4 has significant amount of data then other columns.
Plus I can't use the full browser window because of the requirement. So if you re-size the browser window to half width of your computer screen, it looks very bad, the row is wrapped to more than 15 lines.
Ah yep, you should be able to use
columns.width
and set it to50%
- I have on my wide screen and that works fine. The problem with smaller screens is the number of columns, and the width of the container. You'll need to usescrollX
or make the container a larger width,Colin