I want to achieve this:
I have a table for which columns I want to be able to set a fixed width each in px and % (if the content of a cell is larger than specified, the column is allowed to resize). A column I do not set a width for should resize by its content.
I tried this:
I set
table-layout
tofixed
, and used thewidth
style on the cells. This works perfectly when I set thewidth
of the table as well. But I cannot set the width of the table, since it might shrink columns so that their content overflows.
Example: http://jsfiddle.net/zdY94/I use
min-width
on the cells, which works only with px values and not with %. The examples are available here: px: http://jsfiddle.net/2bNAz/ %: http://jsfiddle.net/2bNAz/1/
So, is there any possibility of having a table which behaves like table-layout: auto
, but with the possibility to specify the width for specific columns in px and %?