skip to Main Content

When I use **collspan=2 **on the cell 28 the table doesn’t have a good view and my expectation is merge cell 28 and 29 without breaking.

    <table width="100%" border="2">
      <tr>
        <td colspan="2" rowspan="2">1</td>
        <td colspan="2">3</td>
        <td colspan="2">5</td>
      </tr>
      <tr>
        <td colspan="2" rowspan="2">9</td>
        <td colspan="2" rowspan="2">11</td>
      </tr>
      <tr>
        <td>13</td>
        <td rowspan="3">14</td>
      </tr>
      <tr>
        <td rowspan="3">19</td>
        <td rowspan="3">21</td>
        <td colspan="2">22</td>
        <td>24</td>
      </tr>
      <tr>
        <td rowspan="2">28</td>
        <td rowspan="2">29</td>
        <td rowspan="2">30</td>
      </tr>
      <tr>
        <td>32</td>  
      </tr>
    </table>

2

Answers


  1. Chosen as BEST ANSWER

    table

    Please check the image @epascarello @bjelli


  2. Simple typo. you tried collspan, but it’s colspan.

    the full table row should look like this:

      <tr>
        <td rowspan="2" colspan="2">28 + 29</td>
        <td rowspan="2">30</td>
      </tr>
    

    A word of advice from a very old coder:
    learning this level of table trickery was important in 1999,
    before CSS and flexbox and grid came along.

    Now it’s irrelevant.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search