HTML • Chapter 21 • Foundations to Production
Accessible Tables
Each topic contains substantial explanation, ten focused teaching examples, its own HTML code example, code reasoning, expected browser result, and practice.
21.1 thead tbody and tfoot
thead tbody and tfoot is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For thead tbody and tfoot, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In accessible tables, the markup should remain understandable as a document before presentation is added.
In Chapter 21, a reliable way to learn thead tbody and tfoot is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
thead tbody and tfoot is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid language page example that demonstrates thead tbody and tfoot. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 21, topic 1, example 1.
Example 2: Content variation
Change the text or resource used by thead tbody and tfoot in the booking page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 21, topic 1, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the media page example using thead tbody and tfoot. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 21, topic 1, example 3.
Example 4: Accessibility review
Read the school page example using the semantics of thead tbody and tfoot. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 21, topic 1, example 4.
Example 5: Mobile review
Open the course lesson markup containing thead tbody and tfoot on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 21, topic 1, example 5.
Example 6: RTL review
Translate the news article into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 21, topic 1, example 6.
Example 7: Validation exercise
Run the contact page fragment using thead tbody and tfoot through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 21, topic 1, example 7.
Example 8: Progressive-enhancement check
Use thead tbody and tfoot in the product description so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 21, topic 1, example 8.
Example 9: SEO and semantics review
Inspect how thead tbody and tfoot contributes to the meaning of the profile page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 21, topic 1, example 9.
Example 10: Production review
Review thead tbody and tfoot in the documentation page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 21, topic 1, example 10.
HTML code example
<table>
<caption>Chapter progress</caption>
<thead><tr><th scope="col">Chapter</th><th scope="col">Status</th></tr></thead>
<tbody><tr><th scope="row">Forms</th><td>Complete</td></tr></tbody>
</table>Step-by-step code explanation
- Identify the element or attribute responsible for thead tbody and tfoot.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for thead tbody and tfoot while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for thead tbody and tfoot in Chapter 21. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
21.2 scope Attribute
scope Attribute is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For scope Attribute, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In accessible tables, the markup should remain understandable as a document before presentation is added.
In Chapter 21, a reliable way to learn scope Attribute is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
scope Attribute is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid media page example that demonstrates scope Attribute. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 21, topic 2, example 1.
Example 2: Content variation
Change the text or resource used by scope Attribute in the school page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 21, topic 2, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the course lesson example using scope Attribute. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 21, topic 2, example 3.
Example 4: Accessibility review
Read the news article example using the semantics of scope Attribute. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 21, topic 2, example 4.
Example 5: Mobile review
Open the contact page markup containing scope Attribute on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 21, topic 2, example 5.
Example 6: RTL review
Translate the product description into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 21, topic 2, example 6.
Example 7: Validation exercise
Run the profile page fragment using scope Attribute through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 21, topic 2, example 7.
Example 8: Progressive-enhancement check
Use scope Attribute in the documentation page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 21, topic 2, example 8.
Example 9: SEO and semantics review
Inspect how scope Attribute contributes to the meaning of the event page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 21, topic 2, example 9.
Example 10: Production review
Review scope Attribute in the FAQ page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 21, topic 2, example 10.
HTML code example
<table>
<caption>Chapter progress</caption>
<thead><tr><th scope="col">Chapter</th><th scope="col">Status</th></tr></thead>
<tbody><tr><th scope="row">Forms</th><td>Complete</td></tr></tbody>
</table>Step-by-step code explanation
- Identify the element or attribute responsible for scope Attribute.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for scope Attribute while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for scope Attribute in Chapter 21. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
21.3 Headers Relationships
Headers Relationships is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For Headers Relationships, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In accessible tables, the markup should remain understandable as a document before presentation is added.
In Chapter 21, a reliable way to learn Headers Relationships is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
Headers Relationships is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid course lesson example that demonstrates Headers Relationships. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 21, topic 3, example 1.
Example 2: Content variation
Change the text or resource used by Headers Relationships in the news article. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 21, topic 3, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the contact page example using Headers Relationships. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 21, topic 3, example 3.
Example 4: Accessibility review
Read the product description example using the semantics of Headers Relationships. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 21, topic 3, example 4.
Example 5: Mobile review
Open the profile page markup containing Headers Relationships on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 21, topic 3, example 5.
Example 6: RTL review
Translate the documentation page into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 21, topic 3, example 6.
Example 7: Validation exercise
Run the event page fragment using Headers Relationships through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 21, topic 3, example 7.
Example 8: Progressive-enhancement check
Use Headers Relationships in the FAQ page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 21, topic 3, example 8.
Example 9: SEO and semantics review
Inspect how Headers Relationships contributes to the meaning of the photo story. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 21, topic 3, example 9.
Example 10: Production review
Review Headers Relationships in the support page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 21, topic 3, example 10.
HTML code example
<table>
<caption>Chapter progress</caption>
<thead><tr><th scope="col">Chapter</th><th scope="col">Status</th></tr></thead>
<tbody><tr><th scope="row">Forms</th><td>Complete</td></tr></tbody>
</table>Step-by-step code explanation
- Identify the element or attribute responsible for Headers Relationships.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for Headers Relationships while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for Headers Relationships in Chapter 21. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
21.4 Complex Table Structure
Complex Table Structure is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For Complex Table Structure, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In accessible tables, the markup should remain understandable as a document before presentation is added.
In Chapter 21, a reliable way to learn Complex Table Structure is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
Complex Table Structure is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid contact page example that demonstrates Complex Table Structure. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 21, topic 4, example 1.
Example 2: Content variation
Change the text or resource used by Complex Table Structure in the product description. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 21, topic 4, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the profile page example using Complex Table Structure. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 21, topic 4, example 3.
Example 4: Accessibility review
Read the documentation page example using the semantics of Complex Table Structure. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 21, topic 4, example 4.
Example 5: Mobile review
Open the event page markup containing Complex Table Structure on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 21, topic 4, example 5.
Example 6: RTL review
Translate the FAQ page into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 21, topic 4, example 6.
Example 7: Validation exercise
Run the photo story fragment using Complex Table Structure through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 21, topic 4, example 7.
Example 8: Progressive-enhancement check
Use Complex Table Structure in the support page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 21, topic 4, example 8.
Example 9: SEO and semantics review
Inspect how Complex Table Structure contributes to the meaning of the dashboard shell. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 21, topic 4, example 9.
Example 10: Production review
Review Complex Table Structure in the language page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 21, topic 4, example 10.
HTML code example
<table>
<caption>Chapter progress</caption>
<thead><tr><th scope="col">Chapter</th><th scope="col">Status</th></tr></thead>
<tbody><tr><th scope="row">Forms</th><td>Complete</td></tr></tbody>
</table>Step-by-step code explanation
- Identify the element or attribute responsible for Complex Table Structure.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for Complex Table Structure while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for Complex Table Structure in Chapter 21. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
21.5 Table Captions and Context
Table Captions and Context is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For Table Captions and Context, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In accessible tables, the markup should remain understandable as a document before presentation is added.
In Chapter 21, a reliable way to learn Table Captions and Context is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
Table Captions and Context is part of the HTML structure covered in Chapter 21. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid profile page example that demonstrates Table Captions and Context. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 21, topic 5, example 1.
Example 2: Content variation
Change the text or resource used by Table Captions and Context in the documentation page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 21, topic 5, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the event page example using Table Captions and Context. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 21, topic 5, example 3.
Example 4: Accessibility review
Read the FAQ page example using the semantics of Table Captions and Context. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 21, topic 5, example 4.
Example 5: Mobile review
Open the photo story markup containing Table Captions and Context on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 21, topic 5, example 5.
Example 6: RTL review
Translate the support page into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 21, topic 5, example 6.
Example 7: Validation exercise
Run the dashboard shell fragment using Table Captions and Context through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 21, topic 5, example 7.
Example 8: Progressive-enhancement check
Use Table Captions and Context in the language page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 21, topic 5, example 8.
Example 9: SEO and semantics review
Inspect how Table Captions and Context contributes to the meaning of the booking page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 21, topic 5, example 9.
Example 10: Production review
Review Table Captions and Context in the media page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 21, topic 5, example 10.
HTML code example
<video controls>
<source src="/media/lesson.mp4" type="video/mp4">
<track kind="captions" src="/media/en.vtt" srclang="en" label="English" default>
<track kind="subtitles" src="/media/fa.vtt" srclang="fa" label="فارسی">
</video>Step-by-step code explanation
- Identify the element or attribute responsible for Table Captions and Context.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for Table Captions and Context while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for Table Captions and Context in Chapter 21. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
Chapter 21 review — 10 questions and answers
1. What should you check first when using thead tbody and tfoot?
Answer: Check that the markup for thead tbody and tfoot matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
2. How do you review thead tbody and tfoot before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that thead tbody and tfoot adds real document meaning or browser behavior.
3. What should you check first when using scope Attribute?
Answer: Check that the markup for scope Attribute matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
4. How do you review scope Attribute before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that scope Attribute adds real document meaning or browser behavior.
5. What should you check first when using Headers Relationships?
Answer: Check that the markup for Headers Relationships matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
6. How do you review Headers Relationships before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that Headers Relationships adds real document meaning or browser behavior.
7. What should you check first when using Complex Table Structure?
Answer: Check that the markup for Complex Table Structure matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
8. How do you review Complex Table Structure before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that Complex Table Structure adds real document meaning or browser behavior.
9. What should you check first when using Table Captions and Context?
Answer: Check that the markup for Table Captions and Context matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
10. How do you review Table Captions and Context before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that Table Captions and Context adds real document meaning or browser behavior.