Veda Bites are swipeable micro-lessons — each one teaches exactly one
idea. The bites below come from this kit — swipe through them in the app.
💡 Key Idea
Tables Are Built Row by Row
Rows first, cells inside — that's the rule.
An HTML table is constructed row by row, not column by column. Each `<tr>` defines a row, and cells (`<th>` or `<td>`) live inside that row.
↳ You always write rows first; the browser figures out the columns from the cells inside each row.
📖 Definition
Core Table Tags You Must Know
Four tags power every HTML table.
↳ Memorize these four: table, tr, th, td — every table is built from them.
⚖️ Comparison
<th> vs <td>: Header or Data?
One is bold, one is plain — know why.
↳ Use <th> for labels and <td> for values — never swap them just for styling.
💻 Code Example
A Complete Table with Header and Body
See a real table come together.
↳ Header row first, then one <tr> per data record — that's the standard pattern.
💡 Key Idea
colspan and rowspan: Merging Cells
One cell can span many columns.
↳ Use colspan for horizontal merges and rowspan for vertical merges — but keep them minimal for clarity.
⚙️ Process
Grouping Rows: thead, tbody, tfoot
Split your table into three zones.
These tags don't change the visual look by default, but they organize the table semantically and help screen readers and CSS target sections.
↳ thead, tbody, tfoot make big tables easier to read, style, and print.
⚠️ Common Mistake
Don't Use Tables for Page Layout
Tables are for data, not design.
↳ If the content isn't naturally rows-and-columns data, don't use a table.
✅ Best Practice
Add a Caption for Context
Every table deserves a title.
The `<caption>` tag gives a table a visible title and is read aloud by screen readers, improving accessibility.
↳ Always add <caption> — it's one line that boosts clarity and accessibility.
⭐ Important Fact
Borders Are Not Automatic
No border unless you ask for one.
By default, HTML tables have no visible borders. The old `border="1"` attribute works but is deprecated — modern practice uses CSS `border` or `border-collapse`.
↳ Style table borders with CSS, not the deprecated border attribute.
🎯 Exam Tip
Exam Favourite: Tag Order and Nesting
Examiners love testing nesting order.
↳ Wrong nesting is the #1 reason students lose marks on table questions.
🧠 Memory Trick
Remember the Nesting Order
Table → Row → Cell. Say it thrice.
Think T-R-C: Table contains Rows, Rows contain Cells. Just like a spreadsheet — sheet, row, cell.
↳ T-R-C (Table-Row-Cell) keeps your nesting correct every time.
🌍 Real World
Where Tables Power the Real Web
Tables run more of the web than you think.
↳ Any time data is naturally rows-and-columns, HTML tables are the right tool.
🛠️ Application
Making Tables Accessible
Screen readers need your table's map.
For complex tables, add `scope="col"` or `scope="row"` to `<th>` so assistive tech knows whether a header labels a column or a row.
↳ scope attributes turn a visual table into an accessible one.
🚫 Warning
Empty Cells Break Alignment
Never leave a cell truly empty.
↳ Use in blank cells to preserve table alignment.
❓ Did You Know
Tables Predate CSS by Years
Tables were the original layout tool.
Before CSS Flexbox and Grid existed, web designers used invisible HTML tables to position headers, sidebars, and footers. This is why old websites often look rigid and hard to make responsive.
↳ Tables shaped early web design — modern CSS exists partly to replace them.