w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



td colspan, td rowspan, th colspan, th rowspan

The colspan attribute on the td, th elements:

The rowspan attribute on the td, th elements:

Examples

<tdattribute="value(s)">...<⁄td>Examples
1.colspan= positive integer<td colspan="3"> ... <⁄td>
2.rowspan=positive integer<td rowspan="2"> ... <⁄td>

Video demonstration colspan, rowspan attributes on td, th elements

HTML5 colspan, rowspan on td ⁄th Tutorial

min video details
00:05 video tutorial: colspan, rowspan attributes on td, th elements
00:05 colspan attribute applied on td ⁄ th element allows you to specify the number of columns a td ⁄th element will span
00:09 rowspan attribute applied on td ⁄ th element allows you to specify the number of rows a td ⁄th element will span
00:19 this table has: 4 columns
00:25 and 4 rows
00:29 horizontally td ⁄th will span columns: colspan attribute
00:33 vertically td ⁄th will span rows: rowspan attribute
00:39 the head of the table has 1 row with 4 cells: → th can span maximum 4 columns (horizontally)and no row because there is 1 row in total inside thead element
01:01 th spanned 2 cells from 2 columns
01:05 vertically, td ⁄th will span rows; rowspan attribute
01:10 the body of the table has 2 rows with 4 cells each: → td can span maximum 4 columns (horizontally) and maximum 2 rows (vertically)
01:39 td spanned 2 cells from 2 rows
01:44 one more example: span horizontally → colspan
02:06 td spanned 2 cells from 2 columns
td intro td optional, occurrences td browser display td parents - children td syntaxtd, th, headers attribute
th intro th optional, occurrences th browser display th parents - children th syntax