Loading lesson path
Formula
HTML tables can have cells that span over multiple rows and/or columns.2022
Formula
HTML Table - ColspanTo make a cell span over multiple columns, use the colspan attribute:
<table> <tr> <th colspan="2">Name</th>
Formula
< th > Age </th ></tr> <tr>
Formula
< td > Jill </td >
< td > Smith </td >
< td > 43 </td ></tr> <tr>
Formula
< td > Eve </td >
< td > Jackson </td >
< td > 57 </td ></tr> </table>
The value of the colspan attribute represents the number of columns to span.
Formula
HTML Table - RowspanTo make a cell span over multiple rows, use the rowspan attribute:
<table> <tr>
Formula
< th > Name </th >
< td > Jill </td ></tr> <tr> <th rowspan="2">Phone</th>
Formula
< td > 555 - 1234 </td ></tr> <tr>
Formula
< td > 555 - 8745 </td ></tr> </table>
The value of the rowspan attribute represents the number of rows to span.