html - Firefox - CSS 表 TR/TD 背景问题

标签 html css firefox

我在 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/

相关文章:

jquery - Div 大小取决于单击时从左到右翻译 Angular 的文本

php - &lt;textarea&gt;和MYSQL在php中显示数据

javascript - 使用 Firebug 查找 JavaScript 中的内存泄漏?

html - 径向渐变在 Firefox 中无法正确显示

python - 点击动态按钮不起作用(python)

javascript - 无法从 AngularJS 中的 Controller 初始化对象

javascript - 在 jQuery 的伪元素上使用 .css()

javascript - 如何在 div 中垂直居中图像?

css - 使用 capybara 检查 CSS 是否已更新

Firefox "container is not defined"中的 javascript 错误