« Crash guide to HTML. Lesson 8 - Tables »
...
|
<html> <head> <title>Ackadia - Learn HTML - lesson 8 - tables</title> </head> <body background="stone.jpg"> <center> <table border="3" bgcolor="white" cellpadding="10" cellspacing="5" width="80%"> <tr> <td> <br /><br /> <img src="images/spidersweb.gif" width="75" height="75" alt="Spiders Web" /> "Table" is, obviously, the command to start a table <br /><br /> "Border" is the table outline and can be set from a width of 0 upwards <br /><br /> "Cellpadding" is the padding between the cell walls and the text / images inside. Think of it like a moat around a castle. <br /><br /> "Cellspacing" is the gap (or lack of one) between the cells <br /><br /> "Width" is the width of the resulting table (in pixels). If you don't enter a width the table will be the width of the longest line of text or, if applicable, the biggest image. <br /><br /> "tr" and "td" start a new table row and table cell respecively. You can have any number of cells in a row and any number of rows and a table. The Tables page gives more examples of this. <br /><br /> Tables, rows and cells (and most other commands for that matter) are closed in reverse order with a forward slash, thus: "/td" "/tr" "/table" <br /> <br /> Note: <br /> The use of lower case is intentional. Capiltals are fine in earlier HTML, but invalid in XHTML, even if they appear to work! <br /> <br /> Similarly, you REALLY want to control tables with style sheets when you have the hang of this. <br /> <br /> Width should always go in and can be either as a percentage or as an absolute (ie ="700" instead of ="80%") <br /><br /> Next I'll show you how those links work and add extra cells to the table <br /><br /> </td> </tr> </table> </center> <br /><br /> </body> </html> See this code running in your browser |


