>  Q&A  >  본문

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

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

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


phpcn_u517phpcn_u5172792일 전2043

모든 응답(2)나는 대답할 것이다

  • 数据分析师

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

    rowspan과 colspan을 사용하는 방법에 대한 예를 들어주실 수 있나요? 제대로 이해하지 못한 것 같습니다. - PHP 중국어 웹사이트 Q&A - rowspan 및 colspan 사용 방법을 예시로 들어주실 수 있나요? 제대로 이해하지 못한 것 같습니다 - PHP 중국어 홈페이지 Q&A

    둘러보시고 배워보세요.

    회신하다
    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>

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

    회신하다
    0
  • 취소회신하다