element to label columns.
Prepare to guide students through the process of crafting complex HTML tables. Ensure they understand basic table creation before introducing headers and footers. Highlight the importance of the 'rowspan' and 'colspan' attributes for merging cells. Encourage experimentation with these attributes to see their effects. Finally, review the completed table to ensure understanding.
Live Class Feed
This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity
Warning: Your screen size is quite small for viewing this. Rotate your device into landscape mode if you can.
1 - Create a basic tableFirst, let's create a basic HTML table with a few rows and columns. Use the following code to create a table with 4 rows and 3 columns:
Now, let's add this code to the embedded playground below: 👇 Mark your steps as done as you complete them.
+5 XP
2 - Add a header rowA table header is a row at the top of a table that contains labels for each column. It helps users understand the data in the table by providing context. In HTML, table headers are created using the
👇 Mark your steps as done as you complete them.
+10 XP
3 - Add RowspanIn this step, we will use the Update the first cell of the second row (Cell 4) with the following code and also delete the first cell of the third row (Cell 7):
So the code should look like this:
When you run the code, notice how Cell 4 now spans two rows, merging with Cell 7.
Try changing the rowspan to 3 and removing Cell 10. What happens to the table?
+15 XP
4 - Add colspanNext, we will use the Update the first cell of the first row (Cell 1) with the following code and also delete the second cell of the first row (Cell 2):
So the code should look like this:
When you run the code, notice how Cell 4 now spans two rows, merging with Cell 7.
Try changing the colspan to 3 and removing Cell 3. What happens to the table?
+15 XP
5 - Add a footer rowIn this step, we will add a footer row to our table. A table footer is typically used to display summary information, such as totals or averages, for the data in the table. To create a footer row that spans all three columns, add the following code after the last row:
Now, let's add the footer row to our table. Add the code inside the
+20 XP
Copyright Notice
This lesson is copyright of DigitalSkills.org. Unauthorised use, copying or distribution is not allowed. New Badge 😃 Series
?
Series
You've earned a new award from the series!!! Your new award has been added to your collection! 0/250
🍪
Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies.
Learn more
|
---|