我在 Firefox 中遇到了表格 TR/TD 背景的问题。我有通过 ajax 加载动态内容的表。当我加载内容时,我用绿色背景标记了一些表格行。我为行中的每个 TD 附加了一个背景,但是当我检查它在 Firefox 中的工作方式时,我只在 td 中的文本下 获得背景。 (在 chrome 中,它在整个 td 尺寸上工作得很好)。
http://i.stack.imgur.com/Hv3Z5.jpg
网站网址:http://www.creas.pl/company/apps/moraman/Shipping/CzechRepublic
表:
<table class="data-table" id="shippingTable">
<thead>
<tr class="first last">
<th style="width: 20%;">Typ</th>
<th style="width: 45%;">Opis</th>
<th style="width: 15%;">Wartość zamówienia</th>
<th style="width: 15%;">Koszt transportu</th>
</tr>
</thead>
<tbody id="loadShippingData" style="display: table-row-group;"><tr class="first last odd">
<td style="background: #EAF2D3;">My carrier</td>
<td style="background: #EAF2D3;">opis</td>
<td style="background: #EAF2D3;">10000.00</td>
<td style="border-right: 0; background: #EAF2D3;">5.00</td>
</tr><tr class="first last odd">
<td style="background: #EAF2D3;">Test</td>
<td style="background: #EAF2D3;">opis</td>
<td style="background: #EAF2D3;">10000.00</td>
<td style="border-right: 0; background: #EAF2D3;">99.00</td>
</tr>
</tbody>
</table>
部分CSS:
.data-table {
width: 100%;
}
table {
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
font-size: 100%;
}
.data-table tr.odd.last {
border-bottom: 1px solid #EEEEEE;
}
.data-table th, .data-table td {
padding: 10px;
}
caption, th, td {
font-weight: normal;
text-align: left;
vertical-align: top;
}
最佳答案
使用background-color
代替background
。
检查这个Fiddle .你的代码对我有用(chrome 32 + firefox 26 + ie > 8)
关于html - Firefox - CSS 表 TR/TD 背景问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21101241/