Use captions, header associations and a scrolling region to make a repair timetable easy to read.
A table helps a reader compare one record with another. It works when the reader can hold a column in mind, move across a row, and tell what each value means. This guide builds a repair workshop timetable with named columns, row headings, a caption, and a layout that stays usable on a phone. You will also practise deciding when a table is the right structure and learn how to diagnose a row whose cells appear under the wrong headings.
Give every column a clear job
Write out two or three records before choosing markup. Our workshop schedule has a time, a session title, and a room for every appointment. A reader might compare the rooms across all times or look across one row to check what happens at ten. This is a good fit for a table because the relationship between values depends on both dimensions. A simple list of supplies would be a poor fit. A list has one main dimension, and giving it empty columns just to line up text adds clutter.
Choose headings short enough to scan but specific enough to identify what the values mean. If a column includes a unit, put it in the heading when the unit is constant. Time in this example is displayed in a consistent format. For a published timetable in multiple time zones, identify the local zone near the caption or in the surrounding explanation. Keep the data representation separate from the visuals so a design change does not make the meaning ambiguous.
Decide whether a first column acts as a row heading. A schedule time can identify a row within this small table. A comparison of equipment models might use the model name instead. If no cell identifies the record naturally, do not automatically turn the first data value into a heading. Only assign that role when it helps the reader understand the other values in the row.
Build one complete timetable
Paste this example into the HTML editor. The table has an explicit caption, a header group, a body group, and a scrolling region around it. The region is named so a keyboard user can tell what they have focused when it needs to scroll.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Community workshop timetable</title>
<style>
body { margin: 2rem auto; max-width: 42rem; padding: 0 1rem; font: 1rem/1.5 system-ui; color: #10244a; }
.table-region { overflow-x: auto; border-radius: .7rem; }
.table-region:focus-visible { outline: 3px solid #0053ad; outline-offset: 3px; }
table { min-width: 28rem; width: 100%; border-collapse: collapse; }
caption { text-align: start; padding: .7rem; font-weight: 700; background: #d9f4d6; }
th, td { padding: .7rem; text-align: start; border-bottom: 1px solid #bdd3e6; }
thead { background: #d8edff; }
tbody th { font-weight: 600; }
</style>
</head>
<body>
<main>
<h1>Community workshop timetable</h1>
<p id="scroll-help">If you cannot see a column, scroll the table sideways.</p>
<div class="table-region" role="region" aria-label="Saturday repair sessions" aria-describedby="scroll-help" tabindex="0">
<table>
<caption>Saturday repair sessions</caption>
<thead>
<tr>
<th scope="col">Time</th>
<th scope="col">Session</th>
<th scope="col">Room</th>
</tr>
</thead>
<tbody>
<tr><th scope="row">10:00</th><td>Hand-sewing basics</td><td>Studio A</td></tr>
<tr><th scope="row">11:30</th><td>Replace a zip</td><td>Studio B</td></tr>
<tr><th scope="row">13:30</th><td>Patch a bike tube</td><td>Yard bench</td></tr>
</tbody>
</table>
</div>
</main>
</body>
</html>
Try it in the HTML editor
The caption describes the table as a whole. The header group contains the heading row, and the body group contains the appointments. A row wraps the cells for one record. In each row, the time is a row heading and the other values are data cells. That distinction gives readers more than a bold font. Assistive technology can use heading relationships to provide context while someone moves through the data.
Add data without breaking alignment
Duplicate the final body row and enter a new time, session, and room. Copy the whole row so you keep all the cells in order. If the room is unknown, prefer an explicit label such as “To be confirmed.” A blank cell has no explanation, and omitting the cell can shift the later values. Avoid using a dash when readers cannot tell whether it means unknown, zero, or not applicable. If your data uses a symbol consistently, explain the symbol before people start reading the table.
Treat merged cells as a separate design decision. They can represent a grouping, such as a heading shared by morning sessions, but they make the header relationships harder to trace. If you only want a wider-looking cell, adjust the column or the content rather than adding a span. If the data really needs several levels of headings, check the resulting associations with assistive technology. For beginner projects, two simpler tables with their own captions can be easier to understand than one elaborate table.
When generating rows from records, keep the order stable. For example, work from a list of column definitions rather than the order of keys in each object. HTML special characters in data must be escaped when a server generates the markup, or assigned as text when a browser creates the cells. A values field should never be allowed to change the surrounding row structure simply because it contains a less-than sign.
Keep horizontal scrolling inside the timetable
Make the viewport narrower than the table’s minimum width. The surrounding page should fit, and only the table region should need sideways scrolling. This preserves the meaning of the columns while letting adjacent prose reflow normally. The visible hint tells a reader what to do when the right edge is out of view. Use Tab to reach the region and try the arrow keys when the table overflows. Also test touch scrolling on a phone when you can, because keyboard success alone does not establish how the table feels on touch.
A single short table may be better if you remove the minimum width and let headings wrap. In a dense comparison table, forcing columns to shrink can make labels unreadable. Another option is a separate summary above the full table, such as listing the next two appointments. Keep the original data available so readers can still compare all the records. Simply hiding columns at a breakpoint takes information away from someone based on their screen size.
Do not use a table for unrelated page layout. CSS Grid and Flexbox let you arrange cards without announcing them as rows and columns. A layout table may also force a reading order that does not make sense outside its visual arrangement. Open the CSS editor if you want to practise laying out cards rather than tabular data.
Check the rendered structure before publishing
If one value appears under the wrong heading, count the cells in the affected row and compare the order with the header. Use the browser inspector to see the table structure the browser constructed. An omitted row wrapper or invalid nesting can be repaired in ways that differ from what you imagined when looking at indented text. Use the code formatters to make the source easier to review, then inspect the underlying structure again rather than trusting the visual alignment alone.
Try reading only the caption and headings. They should tell you what question the table answers. Next read one cell in the middle and name the row and column that give it context. If that is difficult, revise the headings or split the table into smaller groups. Finish by testing one long session title and one unknown value at a phone width. For markup details and more complex cases, see MDN’s HTML table reference.
Keep this table maintainable as the schedule changes
If the schedule covers more than one day, decide whether visitors normally compare across days or arrive looking for one particular date. A table for each date can have a useful caption and repeat the three headings without making people track a date column. If readers want a complete week at once, use a date column with an explicit value for each row, then check that two appointments at the same time can still be distinguished. Keep the order chronological and avoid putting past appointments between future ones.
For a small static page, a reviewer can compare the rendered row count against the booking list. Have them check one row at the top, one in the middle, and one at the bottom against the source. If you later add sorting controls, update the table’s accessible sort state and verify that activating the control rearranges complete rows rather than cells independently. A visually sorted time column is misleading if the accompanying room has not moved with it.