Fluid/Dynamic Table Width
Fluid/Dynamic Table Width
I was wondering how to make the table width fluid. I'd like to be able to set a minimum width, and then grow as screen real estate increases. I looked for this functionality in the docs/api, but I couldn't find anything.
Is this possible?
Is this possible?
This discussion has been closed.
Replies
Yes indeed this is possible. What you need to do is disable DataTables' auto column width calculation by using bAutoWidth: http://datatables.net/usage#bAutoWidth
By default DataTables will calculate optimal width of column based on the information in them in order to stop the column sizes jumping around during paging. As part of this process DataTables applies a fixed pixel width to the table and individual columns. If you set bAutoWidth to false, then these absolute values are not applied and therefore you can us relative values such as 100%.
Hope this helps,
Allan
Thanks for the response!
I see a lot of these types of questions in the forums; perhaps more examples are needed for one-off features like these?
Yes - more examples are on my (ever expanding!) to-do list :-). There are a number of new ones in 1.5 which I'll include, and I also plan on constructing an FAQ now that I know what the common questions truly are (rather than just marketing rubbish FAQs...!).
Regards,
Allan