w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



colgroup ... ⁄colgroup syntax

Syntax colgroup

Examples colgroup syntax

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

<table>
<colgroup>...
...
</table>

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

<table>
... </colgroup>
...
</table>

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

<table>
<colgroup>...</colgroup>
...
</table>

</body>
</html>

Video demonstration colgroup element, syntax

HTML5 colgroup element, syntax Tutorial

min video details
00:05 video tutorial: colgroup element, syntax
00:09 adding colgroup element in page
00:16 colgroup element has:

- a start tag: <colgroup>
- and an end tag: <⁄colgroup>
00:23 both tags (start tag, end tag) may be omitted in some cases
00:25 start tag <colgroup>:
can't be omitted if the element is empty
00:27 start tag absent, the element is empty → this is wrong
00:32 adding span attribute on it
00:34 colgroup element is still empty
00:40 start tag absent, the element is empty, span attribute unattached to start tag → this is wrong
00:46 nesting col elements inside colgroup element
00:49 colgroup element is no longer empty
00:52 start tag absent, the element is NOT empty → this is correct
01:03 since <colgroup> start tag is absent and there's a colgroup element with a missing end tag <⁄colgroup> right above → 1 colgroup element with 4 columns instead of 2 colgroup elements with 2 columns each
01:12 if you want 2 colgroup elements with 2 columns each, and the start tag of the 2nd colgroup absent, make sure the end tag <⁄colgroup> of the 1st colgroup element is PRESENT
01:20 according to web standards, end tag <⁄colgroup> may be omitted: when the element "is not immediately followed by a space character or a comment"
colgroup intro colgroup optional colgroup browser display colgroup parents - children colgroup span attribute