开发者

How to create a table with two columns, the first one's width is Auto and the second one is 100%

开发者 https://www.devze.com 2023-03-02 10:24 出处:网络
In a table: How to set width for columns to implement the following: Two columns, the width of the first one is fit the maximum width of content. and the width of the s开发者_开发百科econd one is th

In a table:

How to set width for columns to implement the following:

Two columns, the width of the first one is fit the maximum width of content. and the width of the s开发者_开发百科econd one is the rest of the table's width.


<style type="text/css">
    table, 
    td.col2 {width:100%}
    td.col1 {white-space:nowrap;}
</style>

<table>
    <tr>
        <td class="col1">Column 1 content here</td>
        <td class="col2">Column 2 content here</td>
    </tr>
</table>
0

精彩评论

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

关注公众号