E-Commerce Newbie
Page: Tables

Start Here!
   Domain Name
   Web Hosting
   Affiliate Marketing
   Websites
   Stores
   Product Reviews
   Sales Letters And Squeeze Pages
   Blogs
   Forums
   Web Directory
   PLR Websites
   Dating & Community
   Membership Websites
   How To Build An Online Store
   Web Site Building Software
   Writing Websites
   Website Promotion
Store
   Free
   Templates
   List Building Materials
   Tracking Software
   Niche Mini Sites
   Web Site Builders
   Maximize Sales
   Ad Creators
   Joint Venture Software
   Security
   Webmaster Tools
Resources
   Affiliate Programs
   Free Webmaster Tools
   E-Commerce Online Tools
   Keyword Density
   Associated Keyword Finder
   Free pdf Convertor
   HTML Tips
   Html Colour Codes
   Tables
   Scripts
   Htaccess Tricks
   DLG Membership Test
Articles
   Affiliate Marketing
   Adult Affiliate Marketing
   Affiliate Marketing Forum
   Affiliate Marketing Networks
   Affiliate Marketing Software
   Affiliate Marketing Tool
   Affiliate Marketing Tracking
   Affiliate Marketing Newbie
   Affiliate Sales without Website
   Wordpress Review Site
   Super Affiliate Training
   Domain Names
   Buying Domain Names
   Buy Sell Domain Names
   Domain Name Value
   Domain Value Calculator
   Email Domain Hosting
   Sell Domain Name
   Transfer Domain Names
   Whois Domain Name Search
   List Building
   Building an email list
   List Building Service
   List Building System
   List Building Techniques
   List Building Tools
Courses
Definitions
Contact Us
Privacy

Tables

Using Tables is an easy way to keep your information aligned on the page.

I have read any number of tutorials on tables & found most of them very confusing so forgive me if this is written too simple but i think it is necessary to understand how tables are constructed.

A simple Table

One Two

The code for this table is;

<table style="width=100%" cellspacing="1" cellpadding="5" border="8">
<tbody>
<tr>
<td valign="top" align="center" width="150">One</td>
<td valign="top" align="left">Two</td>
</tr>
</tbody>
</table>

1/ <table starts the table command, the overall size of the table is 200 pixels, cell spacing is the distance between the 2 cells "1pixel", Cell padding is the area around the text before the border, border is the width of the outside line "8 pixels"

2/ "<tbody>" tags define what is included within the table

3/ "<tr>" = Table Row everything between the "<tr>" & "</tr>"will be on the same row.

4/ "<td>" = Table Data - information contained within the table, in this example there is 1 row & 2 table data's this gives 2 boxes (cells).

5/ Valign="top" table data is justified to the upper border, align="left" table data is justified to the left of the cell.

6/ width="150" this sets this cell to 150 pixels as the overall table is 200 pixels then the other cell will automatically be set to 50 pixels. This can also be done using a percentage value 75% leaving 25% for the other cell.

7/ "<tr>", "</tbody>", "</table>" end of row, end of tables body, end of table.

Copy the above code to your html editor put it in source not designer & play around with the values to see how they effect the overall look.

Download Free HTML editor - NVU Web Design Editor 

OK so those are the basics of a table, please follow my advice & understand the above before continuing - Try adding a third cell

Advanced Tables

 a  b
 c  d  e  f
 g  h  i
 j  k
 l  m  n  o
 p

 I think this table should be advanced enough for now, It may look complicated but it breaks down into easily understood sections.

The opening is the same as before;

 <table style="width=100%" cellspacing="1"cellpadding="0"border="1">
<tbody>

 The full table consists of 6 Columns & 4 Rows & the code is written row by row.

1st Row has 2 cells each cell spans 2 columns so is written like this;

<tr>
<td valign="top" align="left" colspan="2">a</td>
<td valign="top" align="left" colspan="2">b</td>
</tr>

 The only difference from the 1st table is the introduction of colspan="2" because each cell spans 2 columns.

The 2nd row has all 4 columns, so is written the same as in the first table but with 4 Table Data's - 's

<tr>
<td valign="top" align="left">c</td>
<td valign="top" align="left">d</td>
<td valign="top" align="left">e</td>
<td valign="top" align="left">f</td>
</tr>

 The third row is a little different it has 3 cells so will have 3 's however the second cell spans 2 columns so will have a colspan="2" plus it spans 2 rows so it will also have a rowspan="2" - this is the full code..

<tr>
<td valign="top" align="left">g</td>
<td valign="top" align="left" colspan="2" rowspan="2">h</td>
<td valign="top" align="left">i</td>
</tr>

 Here's the catch The fourth row is now only"2" cells not "3" Because the center cell on the previous row spanned 2 rows it is not included in this row. That means only 2 <td>'s

<tr>
<td valign="top" align="left">j</td>
<td valign="top" align="left">k</td>
</tr>

 Now its easy again the fifth row has all 4 cells so has 4 <td>'s

<tr>
<td valign="top" align="left">l</td>
<td valign="top" align="left">m</td>
<td valign="top" align="left">n</td>
<td valign="top" align="left">o</td>
</tr>

 Finally the last row has 1 cell that spans all 4 columns so it only has 1 <td> but also has a colspan="4"

<tr>
<td valign="top" align="left" colspan="4">p</td>
</tr>

 That's it other than the closing statements </tbody>&</table>

Hopefully you get the idea now, work in rows & columns each row starts with <tr> & ends with </tr> Columns are made up of cells <td>cell</td>

Good luck with your table building

 
Bookmark this page
Google Bookmarks Delicious Yahoo My Web Digg Facebook