0

CSS テーブルを使用していますが、予期しない結果が発生しました。テーブルの列が正しく整列しません。テーブルはこんな感じ

ここに画像の説明を入力

ここにCSSがあります

* {
    /* old-style reset here :) */
    border: 0px;
    padding: 0px;
}

table {
    border-collapse: separate;
    border: 1px solid #9DABCE;
    border-width: 0px 0px 1px 1px;
    margin: 10px auto;
    font-size: 20px;
    width:90%;
}
td, th {
    width: 41px;
    height: 41px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    vertical-align: middle;
    background: url(../img/cells.png);
    color: #444;
    position: relative;
}
th {
    font-weight: bold;
    font-size: 14px;
}
td.today {
    background-position: 81px 0px;
    color: white;
}

そして、ここにテーブルHTMLがあります

 <table cellspacing="0">
            <thead>
                    <th>Core Measure</th><th>National Average</th>
            </thead>
            <tbody>
                <tr>
                    <td class="today">Discharge Instructions</td>
                    <td class="today">91%</td>
                </tr>
                <tr>
                    <td class="today">Measure LV Systolic Function</td>
                    <td class="today">98%</td>
                </tr>
                <tr>
                    <td class="today">ACE/ARB for LVSD</td>
                    <td class="today">95%</td>
                </tr>
                <tr>
                    <td class="today">Smoking Cessation</td>
                    <td class="today">99%</td>
                </tr>
            </tbody>
            <tfoot>
                    <th>Core Measure</th><th>National Average</th>
            </tfoot>
        </table>

この問題を解決するための支援をいただければ幸いです。ありがとうございました。

4

1 に答える 1

1

これは、スプライトと設定した背景位置の値に関係しています。私はあなたのためにフィドルを作りました、そしてそれは大丈夫です。

于 2012-06-29T17:40:08.630 に答える