Reputation: 9698
I am curious if there is a way to set one of the columns to 'absorb' any extra width. For instance, I want all the columns to have auto width to the smallest possible width that the data within allows (without text wrapping) and I want one column to expand to whatever width is necessary to fill the table to 100%.
Or if anyone knows how, to set the table width to automatically only take up the necessary width.
Upvotes: 5
Views: 2422
Reputation: 27405
http://jsfiddle.net/pxfunc/gFa29/
table {width:100%;border:solid 2px #ddd;}
th, td {white-space:nowrap;border:solid 1px #eee;}
.fill {width:95%}
nowrap
td
or th
cells to a high % width to absorb the extra spaceUpvotes: 5