表平行的rowpans

时间:2017-11-03 23:35:48

标签: html html-table

更新

更多已解决的示例 here

-

我在桌子上使用rowpans很难。

我想实现以下目标。

enter image description here

总是赞赏解释。

此外,您认为有助于理解的任何其他示例,请分享。

以下是片段:



<table border='1'>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th>Savings for holiday!</th>
  </tr>
  <tr>
    <td rowspan="2">January</td>
    <td>$100</td>
    <td>$50</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

<br><br><br>

<table border='1'>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th>Savings for holiday!</th>
  </tr>
  <tr>
    <td rowspan="2">January</td>
    <td>$100</td>
    <td>$50</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

尝试以下代码,如果您了解表的流程如何工作,它很容易理解

&#13;
&#13;
<table border='1'>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th>Savings for holiday!</th>
  </tr>
  <tr>
    <td rowspan="2">January</td>
    <td rowspan="2">$100</td>
    <td>$50</td>
  </tr>
  <tr>
    
    <td>$80</td>
  </tr>
</table>

<br><br><br>

<table border='1'>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th>Savings for holiday!</th>
  </tr>
  <tr>
    <td rowspan="2">January</td>
    <td>$100</td>
    <td rowspan="2">$50</td>
  </tr>
  <tr>
    <td>February</td>
    
  </tr>
</table>
&#13;
&#13;
&#13;