即使父表较小,我如何才能拥有其内容大小的表呢?
看一下这个示例:http://jsfiddle.net/GtVx8/3/
第一个表宽150 is,第二个表宽200 is。如何使用以下限制使第一个表为200 be?
发布于 2011-12-01 01:47:39
不确定我是否理解这个问题,但您可以将表的宽度强制为<table width="200">
编辑:然后将所有内容包装在div容器中,并给表容器100%的宽度,如下
<div>
<div style="width:100%">
<table >
<tr style="display:block">
<td style="width:100px;background:red">hello</td>
<td style="width:100px;background:green">world</td>
</tr>
</table>
</div>
<div style="width:200px">
<table>
<tr>
<td style="width:100px; background:red">hello</td>
<td style="width:100px; background:green">world</td>
</tr>
</table>
</div>
</div>https://stackoverflow.com/questions/8335545
复制相似问题