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

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

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


phpcn_u517
phpcn_u517

répondre à tous(2)
数据分析师

Comment utiliser rowspan et colspan ? Pouvez-vous donner un exemple ? J'ai l'impression de ne pas avoir bien compris - Questions et réponses sur le site PHP chinois - Comment utiliser rowspan et colspan Pouvez-vous me donner un exemple ? J'ai l'impression de ne pas l'avoir bien compris - Questions et réponses sur le site Web chinois PHP

Jetez un œil autour de vous et apprenez.

阿神

合并单元格而已,和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>

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

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal