[an error occurred while processing this directive]
|
123 Web Design! Creating tables Tables can get quite hairy to create, but they are a very important part of HTML, and must be learnt eventually. In this section, I'll cover the general syntax for creating tables- complex tables are beyond the scope of this tutorial, though. All tables involve using the below three tags:
The best way to illustrate how to create tables is to begin by showing the syntax involved in creating a basic table: <table>
Take special note of the structure of the tags- All tables begin with the <table> tag, followed by at least one <tr> tag, and then by at least one <td>. Lets take the above a little further and create a table with two cells (as opposed to just one): <table
border=1>
Want to try for a table with two rows, and two cells in each of the row? <table
border=1>
Since we wanted two rows, we defined two <tr> tags. Since we wanted two cells in each of the row, we defined two <td> tags inside each of the <tr>. Not that bad, right? -Table attributes Before we get too carried away with creating tables, its appropriate to first introduce the attributes available in manipulating a table's appearance, such as border size, background color, row/cell width etc. Below lists these important attributes:
I encourage you to individually try out all of these attributes; here's an example that uses several of the attributes at once: <table
border="2" width="136"
background="backgr15.jpg" cellspacing="0"
cellpadding="0">
|