一个简单的问题,我想知道,2011 年调整 html 表格大小的正确方法是什么? (当然包含表格数据!)
下面的方法还应该继续吗?
<tr>
<th width="45%">Name</th>
<th width="10%">Author</th>
<th width="20%">Description</th>
<th width="10%">Rating</th>
<th width="15%">Download</th>
</tr>
或者给每一列一个 ID(或类)并用 CSS 设置它的宽度会更好吗?
感谢您的参与!
最佳答案
<table>
<col class="x"/>
<col class="y"/>
<col class="z"/>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
...并将样式应用于类:
col.x {
...
}
关于html - 调整 html 列大小的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4605896/