π§ Email: puthea.khem@gmail.com π¬ Telegram: t.me/iamputhea
By the end of this exercise, students will be able to:
- Create HTML tables using
<table>,<tr>,<th>, and<td> - Use
colspanandrowspanattributes - Add captions and padding to tables
- Understand border collapsing and spacing
Instructions:
- Create an HTML file named
basic-table.html. - Build a table displaying the following student grades:
| Name | Math | Science | English |
|---|---|---|---|
| Alice | 85 | 90 | 88 |
| Bob | 78 | 82 | 79 |
| Charlie | 92 | 87 | 91 |
- Add a caption:
"Student Grades - Semester 1" - Add borders to the table and collapse them.
- Apply padding of 10px to each cell.
Instructions:
- Create a file named
colspan-example.html. - Create a table to display ticket sales:
| Saturday | Sunday | |
|---|---|---|
| Tickets Sold | 120 | 135 |
| Total Sales | $600 | $675 |
- Add a caption:
"Weekend Ticket Sales" - Use
<th>and<td>properly and apply thescopeattribute.
Instructions:
- Create a file named
rowspan-example.html. - Create a TV schedule table:
| Time | ABC | BBC | CNN |
|---|---|---|---|
| 6pmβ7pm | Movie | Comedy | News |
| 7pmβ8pm | Sport | Current Affairs |
- The "Movie" entry under ABC should span two rows.
- Use the
rowspanattribute properly.
Create a custom HTML table for your weekly class schedule:
- Include at least 5 rows and 5 columns.
- Use
colspanorrowspanwhere necessary. - Add a styled caption.
- Apply CSS styles for border, padding, and spacing.
π Reference:
