如何在三列表

时间:2015-07-31 11:31:22

标签: html css

我在调整最后一行时遇到问题。我希望最后一行包含两个大小相同的td

<table>
    <tr>
        <th >Monthly Savings</th><th>Monthly Savings</th><th>Monthly Savings</th>
    </tr>
    <tr>
        <td>January</td>
        <td>$100</td><td>$100</td>
    </tr>
    <tr>
        <td colspan="2">February</td>
        <td colspan="2">$80</td>
    </tr>
</table>

2 个答案:

答案 0 :(得分:0)

删除colspan中的td <td colspan="2">February</td>

<td>February</td>

&#13;
&#13;
table, td{border:solid 1px red;}
&#13;
<table>
    <tr>
    <th >Monthly Savings</th><th>Monthly Savings</th><th>Monthly Savings</th>
    </tr>
    <tr>
    <td>January</td>
    <td>$100</td><td>$100</td>
    </tr>
    <tr>
    <td >February</td>
    <td colspan="2">$80</td>
    </tr>
    </table>
&#13;
&#13;
&#13;

<强> Updated Demo

答案 1 :(得分:0)

<table>
  <tr>
    <th>Monthly Savings</th>
    <th>Monthly Savings</th>
    <th>Monthly Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td colspan="2">$80</td>
  </tr>
</table>

这是你期待的吗?