What is the use of colspan and rowspan in HTML?

colspan merges a cell with the cells next to it (across columns), and rowspan merges it with the cells below (down rows).

<table>
  <tr>
    <th colspan="2">Report</th>
  </tr>
  <tr>
    <td rowspan="2">Marks</td>
    <td>Maths: 90</td>
  </tr>
  <tr>
    <td>Science: 85</td>
  </tr>
</table>

Remember to remove the extra cells that are covered by the merged cell. See Rowspan and Colspan.


Learn more about the similar topics:
Tutorials
HTML Lists
HTML Tables
HTML Table Rowspan & Colspan
Exercises & Assignments
Write an HTML program to create an unordered list of fruits
Write an HTML program to create an ordered and a nested list
Write an HTML program to create a table of student marks
Write an HTML program to create a table with colspan and rowspan
Interview Questions & Answers
What are different tags to list items in HTML?
How do you create a table in HTML?
What is the use of colspan and rowspan in HTML?