IE 8表填充问题

时间:2012-06-29 08:56:26

标签: css internet-explorer firefox html-table

我创建了一个包含以下代码的表:

<table class="details resultTable">
<thead class="details">
<tr class="details">
<th class="details headerText">Heading 1</th>
<th class="details headerText">Heading 2</th>
</tr>
</thead>
<tbody class="imu-details-view">
<tr class="details">
<td class="details">Text 1</td>
<td class="details">Text 2</td>
</tr>
</tbody>
</table>

这是表格的CSS

resultTable {
    border-collapse: collapse;
    text-align: left;
    width: 100%;
}
resultTable th {
    border-bottom: 2px solid #6678B1;
    padding: 10px 8px;
}
resultTable td {
    border-bottom: 1px solid #CCCCCC;
    padding: 6px 8px;
}

现在我遇到的问题是,在Firefox中,表格如下:

enter image description here

然后在IE 8/9中,这就是它的样子:

enter image description here

有人可以解释一下我如何让IE表看起来像Firefox吗?

1 个答案:

答案 0 :(得分:0)

尝试以下代码。将align = left添加到标记。

 <th align="left" class="details headerText">Heading 1</th>
 <th align="left" class="details headerText">Heading 2</th>