3

jquery モバイルでリフロー テーブルを使用するのに忙しいです。テーブルの最初と最後の行の端を丸くしたいと思います。私は次のコードを使用しています:

th:first-child {
   -moz-border-radius: 6px 0 0 0;
   -webkit-border-radius: 6px 0 0 0;
   border-radius: 6px 0 0 0;
}

th:last-child {
   -moz-border-radius: 0 6px 0 0;
   -webkit-border-radius: 0 6px 0 0;
   border-radius: 0 6px 0 0;
}

HTML はこれに似ています。

<table>
<thead>
    <tr>
        <th>First column</th>
        <th>Second column</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>Row one, cell one</td>
        <td>Row one, cell two</td>
    </tr>
    <tr>
        <td>Row two, cell one</td>
        <td>Row two, cell two</td>
    </tr>
    <tr>
        <td>Row three, cell one</td>
        <td>Row four, cell two</td>
    </tr>
</tbody>

文字通り、一番上と一番下のセルの端を丸くしたいだけです。

4

3 に答える 3

2

これで少し近づいた…

thead tr:first-child th:first-child {
   -moz-border-radius: 6px 0 0 0;
   -webkit-border-radius: 6px 0 0 0;
   border-radius: 6px 0 0 0;
}

thead tr:first-child th:last-child {
   -moz-border-radius: 0px 6px 0 0;
   -webkit-border-radius: 0px 6px 0 0;
   border-radius: 0px 6px 0 0;
}

tr:last-child td:first-child{
   -moz-border-radius: 0px 0px 0px 6px;
   -webkit-border-radius: 0px 0px 0px 6px;
   border-radius: 0px 0px 0px 6px;
}

tr:last-child td:last-child{
   -moz-border-radius: 0px 0px 6px 0px;
   -webkit-border-radius: 0px 0px 6px 0px;
   border-radius: 0px 0px 6px 0px;
}
于 2013-07-04T09:36:33.437 に答える
0

テーブル自体に境界線のプロパティを与えることで機能します。

table {
  border: 1px solid #000;
  -moz-border-radius: 6px;
  -webkit-border-radius: 6px;
  border-radius: 6px;
}

デモ

于 2013-07-04T09:46:35.047 に答える