Know and understand why tables were once used to structure elements within a web page and be able to evaluate when a table‑based layout is appropriate for the intended audience and device.
When studying tables for layout we focus on the HTML layer (structure) and the CSS layer (presentation).
<table>, <tr>, <td> (and optional <th>) are required.<tr>/<td> elements increase HTML size.| Aspect | Table Layout | CSS Layout (Flexbox / Grid) |
|---|---|---|
| Semantic meaning | Low – interpreted as data tables | High – HTML describes content; CSS describes presentation |
| Responsive design | Complex – requires nested tables or scripts | Built‑in with media queries, flex‑wrap, grid‑auto‑fit |
| Accessibility | Screen readers announce a data table; navigation can be confusing | ARIA roles/landmarks can be added; linear reading order is preserved |
| Maintenance | Hard – many rows/columns to edit for a small change | Easy – change a single CSS rule or adjust a grid template |
| Browser compatibility | Excellent on very old browsers (Netscape 4, IE 4) | Supported by all modern browsers (Chrome, Edge, Firefox, Safari) |
| Performance | More HTML markup → larger download | Less markup; CSS is cached separately |
| Legacy support | Works without any CSS – useful for extremely old environments | Requires CSS support; not suitable for pre‑1998 browsers |
<!DOCTYPE html> declaration.<body>, insert a <table> element.<tr>.<td id="nav">…navigation links…</td><td id="content">…main article…</td>100% so it spans the full browser width:
<table width="100%" border="0">
width attribute or, preferably, with CSS):
td#nav { width: 20%; vertical-align: top; }
td#content { width: 80%; }
</tr> and </table>.Mapping to assessment objectives: Steps 1‑5 demonstrate knowledge of HTML structure (AO2); Steps 6‑7 show application of CSS for presentation (AO2); the whole procedure reflects the ability to produce a functional layout (AO2).
| Criterion | Table layout suitable? | Reason (AO3 justification) | CSS layout preferable? | Reason (AO3 justification) |
|---|---|---|---|---|
| Content is genuinely tabular (e.g., price comparison) | Yes | Semantic markup matches the data; no extra CSS needed. | No | Using a table avoids unnecessary CSS and keeps the markup simple. |
| Project must run on very old browsers (pre‑1998) | Yes | Older browsers do not understand Flexbox/Grid or media queries. | No | CSS layout would be ignored or rendered incorrectly. |
| Design needs to adapt to phones, tablets and desktops | No | Tables require complex nesting or JavaScript to become responsive. | Yes | Flexbox/Grid + media queries provide native, maintainable responsiveness. |
| Accessibility for screen‑reader users is a priority | No | Screen readers treat tables as data tables, disrupting navigation. | Yes | Semantic HTML + ARIA landmarks give a clear reading order. |
| Team prefers quick visual layout in a WYSIWYG editor | Possibly (legacy editors only) | Older editors visualise table grids directly. | Yes (modern editors) | Current WYSIWYG tools now render CSS visually, removing the need for tables. |
| Syllabus code | Content covered | Assessment objective(s) |
|---|---|---|
| 21.0 | Reason for using tables; link to audience‑appropriate layout | AO1 |
| 21.1 | HTML, CSS, (note: scripting not required) | AO1 |
| 21.2 | Historical reasons – limited early CSS support | AO1 |
| 21.3 | Advantages – predictable rendering, simple markup, WYSIWYG ease, suitability for real data tables | AO1 |
| 21.4 | Disadvantages – non‑semantic, size, accessibility, maintenance, poor responsiveness; modern alternatives (Flexbox, Grid) | AO2 |
| 21.5 | Side‑by‑side comparison table (semantic meaning, responsiveness, accessibility, maintenance, compatibility, performance, legacy support) | AO3 |
| 21.6 | Step‑by‑step procedure for a two‑column table layout (mapped to AO2) | AO2 |
| 21.7 | Evaluation rubric with justified criteria (when to use tables vs. CSS) | AO3 |
| 21.8 | Key take‑away – legacy knowledge vs. modern best practice | AO1 / AO3 |
Tables were once a convenient shortcut for page layout because early browsers lacked robust CSS support. Modern CSS techniques (Flexbox, Grid, media queries) provide cleaner, semantic, accessible and responsive solutions. However, legacy web sites and exam questions may still contain table‑based layouts; students must be able to read, modify, and evaluate them, and decide when a table is genuinely appropriate versus when CSS is the better choice.
Create an account or Login to take a Quiz
Log in to suggest improvements to this note.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.