开发者

How can I resize my columns to fit their text width instead of all being the same width

My table is fixed at 100%

table-lay开发者_如何学Goout:fixed
width:100%


You should remove the table-layout:fixed.

Fixed is specifically for ignoring the contents..

look at https://developer.mozilla.org/en/CSS/table-layout


As answered already you would still have to remove table-layout:fixed;

but, as I think you are saying, this means the table column widths will likely be calculated by the first row "heading" widths, which is not always optimal what you might have to do, depending on how many columns is to use the the col & colgroup elements - reference - to set percentage widths for each column, that way your preferences will be used over the browsers "first pass".. make sure they total 100% and your table should be OK

a code example from you would help see if this is an option, or indeed if there's a better one!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜