80 likes | 327 Views
Introduction to HTML 4.0. Getting Started – Table 1. Teacher: Mr. Ho. Table Tag: <table> … </table>. Most HTML web pages use tables to organize the information. To create a table in your HTML page, use: <table border=“1”> < tr > <td>Month</td>
E N D
Introduction to HTML 4.0 Getting Started – Table 1 Teacher: Mr. Ho
Table Tag: <table> … </table> • Most HTML web pages use tables to organize the information. • To create a table in your HTML page,use: <table border=“1”> <tr> <td>Month</td> <td>Expense</td> </tr> <tr> <td>January</td> <td>$100.00</td> </tr> </table>
Table Tag: <table> … </table> • Make sure that in the opening <table> tag, include the border attribute. • Otherwise, your table does not have a border, unless this is what you want.
Table Tag: <table> … </table> • Besides the border attribute, the <table> … </table> has other attributes: • align • bgcolor • width • Check out more at http://www.w3schools.com/tags/ • The width attribute can be in %. <table border=“1” align=“center” width = “75%”>
Table Row Tag: <tr> … </tr> • <tr> … </tr> create a row in a table. • You put your data between <tr> and </tr>. • If you want more than one row in a table, add another <tr> … </tr> after the closing row tag.
Table Data Tag: <td> … </td> • <td> … </td> stands for table data (i.e., column or cell of a table). • Put <td> … </td> between <tr> and </tr>.
Table Example <html> <head><title>Table Example</title></head> <body> <table border=“1”> <tr> <td>Month</td> <td>Expense</td> </tr> <tr> <td>January</td> <td>$100.00</td> </tr> </table> </body> </html>
Questions & Answers • Do you have any questions so far? • If you do, please ask now.