search

Home  >  Q&A  >  body text

rowspan和colspan怎么用呢,能不能举个例子。感觉没吃透

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

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


phpcn_u517phpcn_u5172918 days ago2113

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 00:32:01

    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.

    reply
    0
  • 阿神

    阿神2017-02-25 13:11:27

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

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

    reply
    0
  • Cancelreply