Tables let you present data in a structured way using rows and columns. HTML tables are ideal for things like pricing lists, schedules, or statistics.
Tables start with the <table> tag. Rows are created using <tr>, headers with <th>, and cells with <td>.
Here’s an example of how a simple HTML table looks when rendered in the browser. This helps you visualize how the code appears.
Item | Price | On Sale? |
---|---|---|
Apple | 0.2$ | Yes |
Orange | 0.3$ | No |
Banana | 0.1$ | Yes |
You can use colspan and rowspan on <td> elements to make a cell span multiple columns or rows.
html
<td colspan="2">Occupies two columns</td>
html
<td rowspan="2">Occupies two rows</td>
You can use <thead>, <tbody>, and <tfoot> tags to make your table structure more organized and easier to understand.
Use tables when you need to display structured data. Don’t use them for layout or design — modern CSS solutions are better suited for that.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.