Translate

Pages

Tuesday, 27 March 2012

Adding A Simple Table


Creating a Web Page: Part 3 – Adding A Simple Table
Tables may look complicated at first, but they will be easier to understand if you remember that a table in
HTML is created row by row. Type the tags as shown, and follow the directions in italic type. Use any spacing
or indentation that makes sense to you, but do not change the order of any of the tags. Be sure to insert this
table before the closing body and html tags on your page.
<table>
<tr>
<th> Heading for 1st column . For example: Name</th> <th> Heading for 2nd column. For example: Phone
Number</th></tr>
<tr>
<td> Words in the first row, first column. For example: Coach Ralph Friedgen</td><td> Words in the first row,
second column. For example: X4-7096 </td></tr>
<tr>
<td> Words in the second row, first column. For example: Coach Gary Williams</td> <td> Words in the
second row, second column. For example: X4-7029</td>
</tr>
</table>
Save your document, and preview it in Firefox.


Next, we'll spread out the table by adding space in the cells. This is done by specifying a number, which the
browser interprets as a number of pixels between the text and the cell border. The HTML command for this is
cellpadding. Edit your table to read:
<table cellpadding="5">
You can also change the amount of space between table cells – which is called cellspacing in HTML. Both
cellpadding and cellspacing commands can be used at the same time.
<table cellspacing="5" cellpadding="5">
Once you have made this change, save your file and preview it in Firefox.
Congratulations! You have now created a simple web page with graphics, links, and a table!!!

0 comments:

Post a Comment

Thank you for your valuable comments..

 
Twitter Bird Gadget