【发布时间】:2017-01-21 07:47:58
【问题描述】:
我有一个 HTML 表格,其中我:
- 包括明确的表格宽度。
- 在第一行包含显式宽度。
- 我在列中有图像,但我在图像上包含高度和宽度标签,因此浏览器应该提前知道大小。
-
使用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
这在 Internet Explorer 8、Firefox 和 Chrome 中运行良好。
Internet Explorer 7 似乎不遵循指定为一列的列宽,我设置的列比另一列大得多,但它显示的大小与其他列相同。
我错过了什么?
这里是一些表格 HMTL 和 CSS:
CSS
#mainApplicationsTable
{
table-layout:fixed;
}
HTML:
<table border='0' class='altTable' width='320px' id='mainApplicationsTable'>
<thead>
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class='odd' recnum='51'>
<td width='190px'><div class='appDetailsClic'k id='51' >2</div></td>
<td width='30px'><img width='16px' height='16px' title= 'a' border='0' src="../../images/image.png"></td>
<td width='30px'><img width='16px' height='16px' title= 'Server' border='0' src="../../images/2.png"></td>
<td width='30px'><img width='16px' height='16px' title= 'Server' border='0' src="../../images/2.png"></td>
</tr>
</tbody>
</table>
【问题讨论】:
-
您缺少向我们展示您的问题的 html。请使用显示问题的表格的 html 更新您的帖子。
-
如果您使用的是 XHTML strict,那么您应该在属性周围加上引号 - 可能会触发 IE7 中的 quirks 模式。
-
请在让其他人弄清楚之前验证您的 HTML。缺少引号看起来无效
-
这实际上是一个错字。 .这现在是固定的。 .同样的问题
-
190 + 30 +30+30 = 280,我有 cellpadding 加起来。我的总计中不包括填充吗?
标签: html html-table internet-explorer-7