Library tutorials & articles

Creating tables in HTML

Table controls

Table controls are just controlling factors in the make up of the table, these are:

  • BGCOLOR="#000000" - This will give each cell in your table a background colour, it is possible to give each Row a different colour.
  • WIDTH="50%" - This sets the width of the coloumn as a percentage, this one will take up half of the page.
  • BORDER="20" - This sets the width of the border, this setting will give it a border of 20 pixels.
  • CELLSPACING="10" - This sets the vertical and horizontal distance between each cell.
  • CELLPADDING="10" - This sets the vertical space each cell's text has.
  • BORDERCOLOR="#008000" - This will set the colour of the border.
  • ALIGN="CENTER" - This sets where the table will be positioned on the page, you can also use left and right.
Here is a table using some of the controls mentioned above.

<TABLE BORDER="1" WIDTH="50%" BGCOLOR="#F8FF00" ALIGN="CENTER" BORDERCOLOR="#FF0700" CELLSPACING="10" CELLPADDING="10">
<TR>
<TD> ITEM 1 </TD>
<TD> ITEM 2 </TD>
<TD> ITEM 3 </TD>
</TR>
<TR>
<TD> ITEM 4 </TD>
<TD> ITEM 5 </TD>
<TD> ITEM 6 </TD>
</TR>
</TABLE>

ITEM 1 ITEM 2 ITEM 3
ITEM 4 ITEM 5 ITEM 6

Comments

  1. 23 Apr 2007 at 04:31

    ei dude i learned a lot from ur tutorial... i don't wanna admit it but... i still don't have an idea of making html...

  2. 09 Jan 2003 at 06:06

    nice dude

  3. 01 Jan 1999 at 00:00

    This thread is for discussions of Creating tables in HTML.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related podcasts

  • Top Web Design Mistakes

    Pete LePage is Product Manager of Internet Explorer Developer Division and he doesn’t want your web site to stink. Sharing from his talk given at TechEd 2008, Pete highlights 10 common web design mistakes and tells you how you can bypass the same blunders. Pete also tells us how future features o...

Events coming up

  • Dec 8

    Web Design World

    Boston, United States

    Join your colleagues and top experts in the Web field as Web Design World returns to Boston December 8-10, 2008 for three dynamic days of information, interaction, insight and inspiration.