By the end of this lesson, you'll be able to:
Make sure you:
:information_source: HTML Table is a way to organize information in rows and columns on a web page. Think of it like a grid where you can put text, numbers, or even images in each box!
Tables help you display data clearly. You can use them for:
To create a table, you'll use special blocks:
<table>
is like a container that holds everythingLet's learn about the blocks you'll use to build tables:
Block | What It Does |
---|---|
![]() |
Table Header <th> - Creates bold headings for your columns (like "Name" or "Score") |
![]() |
Table Row <tr> - Creates a new row in your table (horizontal line of data) |
![]() |
Table Data <td> - Creates a cell where you put your actual information |
:bulb: Tip Think of building a table like building with LEGO:
<table>
is your baseplate<tr>
blocks are the rows you stack<th>
and<td>
blocks are the pieces you put in each row
:information_source: Border-collapse is a special property that makes your table borders look cleaner. It decides if the lines between cells should be separate or joined together.
When you use tables, each cell has its own border. This can make your table look messy with double lines everywhere! The border-collapse block helps by:
With Border-Collapse :white_check_mark:
Notice how clean it looks? All borders are single lines!
Without Border-Collapse :x:
See the double lines? That's what happens without border-collapse!
:memo: Note Most professional websites use border-collapse to make their tables look neat and organized.
Here's how to create a complete table step by step:
Code 1 | Code 1 Continuation | Code 2 Continuation |
---|---|---|
![]() |
![]() |
![]() |
*You may view the whole list of code blocks HERE.
Having problems with your table? Check these common issues:
Table not showing?
<table>
block at the start and endRows looking weird?
<tr>
blockHeaders not bold?
<th>
blocks for headers, not <td>
blocksBorders not working?
In this lesson, you learned:
<table>
, <tr>
, <th>
, and <td>
<th>
) make your table easier to understandReady to see tables in action? Watch this video to learn more!
Now it's your turn! Try these challenges:
:bulb: Tip Start small! Build a simple table first, then add more rows and columns as you get comfortable.
Tables are everywhere on the web! You'll find them in:
When you master HTML tables in EduBlocks, you're learning the same skills real web developers use every day!