How to set fixed width for columns of a table with expand/collapse functionality?
I have a table with expand/collapse functionality. How do I enforce fixed width for columns in such a table?
I used COL tags with width property. But the table becomes distorted wh开发者_Python百科en I expand/collapse the rows.
Make sure you set the style table-layout: fixed
on the <table>
element. By default, even with <col>
elements, the browser will go into ‘auto table layout’ mode, where your widths won't necessarily be respected.
精彩评论