Merging table column into single cell

后端 未结 2 737
傲寒
傲寒 2021-01-03 20:43

I have a table that looks like this and this is its markup

______________________
_____|_______|________
_____|_______|________

相关标签:
2条回答
  • 2021-01-03 21:20

    add a rowspan="2" to the second td of the first row and remove the second td from the second row.

    0 讨论(0)
  • 2021-01-03 21:26
    <table>
    <tbody>
    <tr>
     <td>row 1 column 1</td>
     <td rowspan="2">row 1 column 2</td>
     <td>row 1 column 3</td>
    </tr>
    <tr>
     <td>row 2 column 1</td>
     <td>row 2 column 3</td>
    </tr>
    </tbody>
    </table>
    

    This should work. Any element with rowspan="2" will span two rows. you can also put colspan="2" to span columns.

    0 讨论(0)
提交回复
热议问题