70 likes | 185 Views
HTML (2). HyperText Markup Language. 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>. Table Example.
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