0

我有一张看起来像这样的桌子

<table>
<tr>
    <th>Heading</th>
    <td>body</td>
</tr>
<tr>
    <th>Heading</th>
    <td>body</td>
</tr>
</table>

而不是默认情况下让标题浮动。我想坐在上面。

这是我的代码示例 - http://jsfiddle.net/PJQT8/1/

4

2 回答 2

1

将标题单元格放在自己的行中,将数据单元格放在自己的行中。如果您不希望标题单元格占据左列,则不应将它们放在那里。

<table>
<tr>
    <th>Heading</th>
    <th>Heading</th>
</tr>
<tr>
    <td>body</td>
    <td>body</td>
</tr>
</table>
于 2012-10-09T09:40:36.150 回答
0
<table width="499" height="155" class="payment-details">
            <th width="186">Secure Payment details</th>
              <th>Delivery Address</th>
              <th>Billing Address</th>
                <tr class="card">

                    <td width="186">
                  <p>Jane Smith</p>                  </td>
                        <td width="140">
                  <p>Jane Smith</p>                  </td>
                        <td width="157">
                  <p>Jane Smith</p>                  </td>
                </tr>
                <tr class="billing">

                    <td>
                        <p>John Smith</p>                    </td>

                    <td>
                        <p>John Smith</p>                    </td>

                    <td>
                        <p>John Smith</p>                    </td>
                </tr>
                <tr class="delivery">

                    <td>
                        <p>John Block</p>                    </td>
                         <td>
                        <p>John Block</p>                    </td>
                         <td>
                        <p>John Block</p>                    </td>
                </tr>
                <tr class="delivery">
                  <td>&nbsp;</td>
                   <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
</table>
于 2012-10-09T11:28:48.907 回答