It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum Script-archive

HTML, Understanding Tables

Share your completed scripts.

HTML, Understanding Tables

Postby HotNoob on Wed Sep 22, 2010 3:07 am

Tables are not a hard concept to get, in fact, if you've used Microsoft Word than you've probably already got the hang of it.

The table starts with the <table> tag and ends with </table>
New Rows are Created with the tags <tr> and </tr>
And Columns, are created with the tags <td> and </td>

What does TR and TD Stand for?
TR = Table Row
TD = Table Data

Here is a simple example of a table
Code: Select all
<table>
<tr>
   <td>
       Row 1, Col 1
   </td>
   <td>
       Row 1, Col 2
   </td>
</tr>
<tr>
   <td>
       Row 2, Col 1
   </td>
   <td>
       Row 2, Col 2
   </td>
</tr>
</table>


^^^ Will display something like,
Row 1, Col 1 Row 1, Col 2
Row 2, Col 2 Row 2, Col 2

Now that's the basics of tables, however there is a bit more.

The table tag has 3 very useful attributes
cellspacing, cellpadding, and border.
By default cellspacing and cellpadding = 1
And in old browsers the default of border = 1
For formatting reasons you may want to change the cellspacing, cellpadding, and border to 0.

Enjoy!
HotNoob
100+ Club
 
Posts: 169
Joined: Sun May 02, 2010 1:38 am

Who is online

Users browsing this forum: No registered users and 0 guests