Back to HTML Notes
Topic #33

Colspan & Rowspan

Colspan and rowspan let cells stretch across multiple columns or rows, essential for tables with merged headings. They appear constantly in real report layouts.


HTML tables can have cells that span over multiple rows and/or columns.


NAME
APRIL
2022
FIESTA

HTML Table - Colspan

To make a cell span over multiple columns, use the colspan attribute:

Example

  <table>
  <tr>
    <th colspan="2">Name</th>

  <th>Age</th>
  </tr>
  <tr>

  <td>Jill</td>
    <td>Smith</td>

  <td>43</td>
  </tr>
  <tr>
    <td>Eve</td>

  <td>Jackson</td>
    <td>57</td>
  </tr>
</table>

Note: The value of the colspan attribute represents the number of columns to span.


HTML Table - Rowspan

To make a cell span over multiple rows, use the rowspan attribute:

Example

  <table>
  <tr>
    <th>Name</th>

  <td>Jill</td>
  </tr>
  <tr>
    <th rowspan="2">Phone</th>

  <td>555-1234</td>
  </tr>
  <tr>

  <td>555-8745</td>
</tr>
</table>

Note: The value of the rowspan attribute represents the number of rows to span.

Want to go beyond the notes?

Join Coding Now Tech Institute's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Colspan & Rowspan – FAQs

Quick answers about learning Colspan & Rowspan in HTML.

This free note from Coding Now Tech Institute explains Colspan & Rowspan in HTML — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every HTML topic on Coding Now Tech Institute, including Colspan & Rowspan, is 100% free with no signup required.
With focused practice, most students grasp Colspan & Rowspan in 1–3 days from these notes; pairing it with Coding Now Tech Institute's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the Coding Now Tech Institute Community (/community) — expert instructors answer within 24 hours.
Call NowEnroll Now