Build A Website

  Build a Website: Home
  Contact
  Link to Build a Website

 Webmastering
  How to Build a Website
  Planning your Website
  
Uploading Files
  Using a FTP client
  Getting Visitors
  Monitoring Web Traffic
  Publishing Banner Ads

 Web Hosting
  Finding a Web Host
  Moving to a New Host
  Domain Names

 Coding
  HTML Tutorials
  Text Editors
  WYSIWYG Editors

 Blogs
  How do I Make a Blog
  Adding Music to a Xanga

 Graphics
  Hex Color Codes
  Common Banner Sizes

 Forums
  What's a Forum
  Forum Scripts
  Webmaster Forums

 Web Host Reviews
  CirtexHosting Review
  ICDsoft Review
  Sonata Web Review

 Misc.
  Short URLs
  Review of CNcat

 Other Resources
  HTML Tutorials

Making Tables in HTML

Skip to…
  Overview
  Basic table
  Tags that can be added to TR/TD Commands
  FAQ

Overview of making tables for your web page

Tables and frames are some of the most commonly use features in a good web page. This page is made up of 3 tables and a lot of cells, I got rid of the ugly boarders.

Example of a basic table:

The Coding:

<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=150 BGCOLOR="#ffffff" align="center">
<TR>
<TD>
Blah blah blah
</TD>
</TR>
</TABLE>

What is Looks like:

Blah blah blah

Explanation of the tags:

BORDER=1 It can change the thickness of the line that surrounds a table. You can put a 0 if you don't want your table to have a border.
Example:

The Code:

<TABLE BORDER=3 CELLSPACING=0 CELLPADDING=0 WIDTH=150 BGCOLOR="#ffffff" align="center">

<TR>
<TD>
Blah blah blah
</TD>
<TD>
Blahhh
</TD>
</TR>
</TABLE>


The Result:

Blah blah blah Blahhhh


CELLSPACING=0 It puts spaces in between the cells of a table.
Example:

The Code:

<TABLE BORDER=1 CELLSPACING=5 CELLPADDING=0 WIDTH=150 BGCOLOR="#ffffff" align="center">

<TR>
<TD>
Blah blah blah
</TD>
<TD>
Blahhh
</TD>
</TR>
</TABLE>


The Result:
Blah blah blah Blahhh


CELLPADDING=1 It puts spaces in between the edge of the cell to the text.
Example:

The Code:

<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=7 WIDTH=150 BGCOLOR="#ffffff" align="center">

<TR>
<TD>
Blah blah blah
</TD>
<TD>
Blahhh
</TD>
</TR>
</TABLE>


The Result:
Blah blah blah Blahhh


WIDTH=150 It controls how much of the screen it takes up. You can also put a percentage of the screen as the width, so that is stretches in larger or smaller screen resolutions.
Example :

The Code:

<TABLE BORDER=1 CELLSPACING=5 CELLPADDING=0 WIDTH=550 BGCOLOR="#ffffff" align="center">

<TR>
<TD>
Blah blah blah
</TD>
<TD>
Blahhh
</TD>
</TR>
</TABLE>


The Result:
Blah blah blah Blahhh


BGCOLOR="#ffffff" It controls the background color of the table with a hex color.
Example:

The Code:

<TABLE BORDER=1 CELLSPACING=5 CELLPADDING=0 WIDTH=150 BGCOLOR="#006600" align="center">

<TR>
<TD>
Blah blah blah
</TD>
<TD>
Blahhh
</TD>
</TR>
</TABLE>


The Result:
Blah blah blah Blahhh


align="center" Aligns the table to a certain side of the space available.

<TR> TR Starts a new row of cells. </TR> Ends the row of cells.
<TD> TD Starts a new cell. </TD> Ends the cell

Tags that you can add to the TR/TD HTML Commands

There are many things that you add to your TR or TD commands to make the table exactly how you want it.

Extra TR tags

VALIGN=“TOP” It tells the browser to move all of the stuff in the tables to the TOP of the cell.


Extra TD Commands

Width=“A number” It resizes the table to the number of pixels specified in the quotes.

ALIGN=“CENTER, or RIGHT” It centers or pushes the stuff in the table to the right. The text is automatically along the left if you don‘t add it.
Example:
The Middle To the Right To the Left


COLSPAN=“The number of cells you want it to span” I'm not really sure how to explain it with words so I'll show you.
Example:

COLSPAN="3" 3 for 3 cells
1st cell 2nd Cell3rd Cell


ROWSPAN=“The Number of rows you want the cell to span”
Example:

ROWSPAN="4" 4 for 4 TR's
1st cell
2nd Cell
3rd Cell

Frequently Asked Questions about Tables


Can I use all of the TD/TR tags at the same time?
Yes, of course you can!

Are there ither tags I can put in the TR/TD commands?
Yes there are but most of them aren't vaild HTML.

Can I put a table in a table?
Yes you can. Just code a full table inside the table and it should work. Remember to end both of the tables!

Go to...
  HTML Tutorials
  Frame Tutorial
  Hex Color Codes



Copyright © 2003 'Build a Website' by CNW Central.com
Home | Links | Contact


My other sites:   Zoo Tycoon Help      SC's Neopets Help  SciFi Directory