开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜