w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



table nested within elements, elements nested within table

Classified as: flow content, palpable content

Parents, table

Children, table


Note: the above elements can be nested inside table element exactly in this order:
1. caption, colgroup, thead, tfoot, tbody OR
2. caption, colgroup, thead, tbody, tfoot OR
3. caption, colgroup, thead, tfoot, tr OR
4. caption, colgroup, thead, tr, tfoot OR

Examples: table parents, table children

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

<table>
...
</table>

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

<table>
<caption>...</caption>
<colgroup>...</colgroup>
<thead>...</thead>
<tbody>...</tbody>
<tfoot>...</tfoot>
</table>

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

<p>
<table><a>...</a></table>
</p>

</body>
</html>

Syntax 1: Valid, table nested within table: allowed
Syntax 2: Valid, caption, colgroup, thead, tbody, tfoot elements nested within table: allowed
Syntax 3: Invalid, table nested within head, p: not allowed; a nested within table: not allowed

table intro table browser display table syntaxtable border attribute