w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



td nested within elements, elements nested within td

Classified as: sectioning root

Parents, td

Children, td

Examples: td parents, td children

Valid Syntax 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<table>
<caption>...</caption>
<tbody>
<tr>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>

</body>
</html>
Valid Syntax 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!doctype html>
<html>
<head>
<title>...</title>
</head>
<body>

<table>
<caption>...</caption>
<thead>...</thead>
<tr>
<td><a>...</a></td>
<td><img></td>
</tr>
<tr>
<td><span>...</span></td>
<td><u>...</u></td>
</tr>
</table>

</body>
</html>
Invalid Syntax 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!doctype html>
<html>
<head>
<title>...</title>
<td>...
</head>
<body>

<td>...
<p>
<td>...
</p>

</body>
</html>

Syntax 1: Valid, td nested within tr: allowed
Syntax 2: Valid, flow elements (a, img, span, u....see the Children list above) nested within td: allowed
Syntax 3: Invalid, td nested within elements( head, body, p) other than tr: not allowed

Video demonstration nesting td

HTML5 nesting td Tutorial

min video details
00:05 td element nested inside elements;
elements nested inside td
00:10 td element can be nested inside tr element ONLY!
00:20 inside a td element: you can add simply text, OR you can nest all HTML elements classified as flow content

see above the list of elements that can be nested inside td element
00:29 text inside td
00:33 a nested inside td
00:39 hyperlinked text inside td
00:43 p nested inside td (a paragraph inside a data cell)
00:50 img nested inside td (an image inside a data cell)
01:07 other elements inside td (see above the list of elements that can be nested inside td element)
td intro td optional, occurrences td browser display td syntaxtd, th, colspan, rowspan attributestd, th, headers attribute