我有一个三列的表。我正在使用标签来指定列的宽度。示例代码:
<table width="100%" border="1">
<colgroup style="background-color:#FF0000;">
<col width="100px" id="id1"></col>
<col width="80px" id="id2"></col><col id="id3"></col></colgroup>
<tbody>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
<tr>
<td>2489604</td>
<td>My first CSS</td>
<td>$47</td>
</tr>
<tbody>
</table>
问题是 col ($("#id1").width()) 的宽度为 IE 和 Chrome 返回 0,它在 FF 中运行良好。如何获得 chrome 和 IE 中 col 的实际宽度?