70 likes | 197 Vues
This guide covers the fundamental aspects of HTML tables, which are essential for structuring content on a web page. A table consists of rows and cells, where each row is defined using the `<tr>` tag and cells with the `<td>` tag. Learn how to create tables with specific layouts, including how to use the colspan and rowspan attributes to manipulate cell spanning across columns and rows. Practical examples are provided to help you visualize how to implement these concepts effectively in your web designs.
E N D
HTML (2) HyperText Markup Language Computing
Tables • The layout of a web page is created by using a table <table> • A table has a number of rows <tr> • ..and each row has a number of cells <td> Computing
Table Example <table> <tr> <td>Hello</td> <td></td> </tr> <tr> <td></td> <td>People</td> </tr> <tr> <td>Smee</td> <td></td> </tr></table> HTML code for this table would be… Computing
Table Example 2 A cell may span across several columns… <table> <tr> <td colspan=“3” align=“center”>Hello World</td> </tr> <tr> <td>One</td> <td>Two</td> <td>Three</td> </tr></table> Computing
HTML Challenge 1 • Try to output this table on a web page… Computing
Table Example 3 • Sometimes cells may span several rows… <table> <tr> <td rowspan=“3”>Cell spans 3 rows</td> <td>One</td> </tr> <tr> <td>Two</td> </tr> <tr> <td>Three</td> </tr></table> Use the rowspan attribute… Computing
HTML Challenge 2 • Display this table on a web page: Computing