rowspan和colspan怎么用呢,能不能举个例子。感觉没吃透
phpcn_u517
phpcn_u517 2017-02-25 11:25:26
0
2
2110

rowspan:上下单元格合并。合并属性必须放在第一个单元格中。

 colspan:左右单元格合并。合并时,有增就得有减,要保证每一行单元格的个数不变。


phpcn_u517
phpcn_u517

reply all(2)
数据分析师

How to use rowspan and colspan? Can you give an example? I feel like I haven’t understood it thoroughly - PHP Chinese website Q&A - How to use rowspan and colspan? Can you give an example? I feel like I haven’t understood it thoroughly - PHP Chinese website Q&A

Take a look around and learn.

阿神

合并单元格而已,和excel里面的合并单元格是一个意思

<html>
<body>

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

</body>
</html>
<html>
<body>

<table width="100%" border="1">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td colspan="2">January</td>
  </tr>
  <tr>
    <td colspan="2">February</td>
  </tr>
</table>

</body>
</html>

可以运行这两个例子,理解下

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template