📊 HTML Tables Guide

📊 HTML Tables Guide
Tables are used in HTML to display data in rows and columns, similar to spreadsheets. They help structure content like schedules, prices, stats, and more.
| - Defines a data cell (table content) | - Defines a header cell (bold + centered by default)✅ Example:
2. Table Headers (<th>)Used instead of <td> to label columns or rows. They're bold by default. <tr> <th>Item</th> <th>Price</th> </tr> 3. colspan and rowspan AttributesThese attributes allow cells to span multiple columns or rows. ✅ colspan – Stretch across multiple columns:
✅ rowspan – Stretch down multiple rows:
4. Table Caption (<caption>)Adds a title to your table. Must go immediately after the <table> tag.
5. Table Sections: <thead>, <tbody>, <tfoot>Used to group different parts of a table. Makes styling easier and improves accessibility.
Quick SummaryTag - Purpose <table> - Wraps the table <tr> - Table row <td> - Table data cell <th> - Table header cell colspan - Merge columns rowspan - Merge rows <caption> - Table title <thead> - Table header section <tbody> - Table body section <tfoot> - Table footer section Date: 2025-04-07 00:00:00.000000 |
|---|