Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


<TABLE> Elements

The following commands go inside the <TABLE> Tag, for example: <table border="1">. Just reference the <TABLE> Tag for now, we'll cover Rows and Columns (<TR> and <TD>) later.

hr1.gif (724 bytes)

BORDER - The border thickness in pixels.

Border = 4 Border = 4
Border = 3 Border = 3
Border = 10 Border = 10

tablecode.gif (633 bytes)

<table border="10">
<tr>
<td>Border = 10</td>
<td>Border = 10</td>
</tr>
</table>

hr1.gif (724 bytes)

CELLPADDING - Pixels between the cell data and cell wall.

Cell Padding = 5 Cell Padding = 5
Cell Padding = 10 Cell Padding = 10
Cell Padding = 0 Cell Padding = 0

tablecode.gif (633 bytes)

	
<table cellpadding="0">
<tr>
<td>Cell Padding = 0</td>
<td>Cell Padding = 0</td>
</tr>
</table>

hr1.gif (724 bytes)

CELLSPACING - Pixels between cells.

Cell Spacing = 5 Cell Spacing = 5
Cell Spacing = 10 Cell Spacing = 10
Cell Spacing = 0 Cell Spacing = 0

tablecode.gif (633 bytes)

		
<table cellspacing="0">
<tr>
<td>Cell Spacing = 0</td>
<td>Cell Spacing = 0</td>
</tr>
</table>

hr1.gif (724 bytes)

WIDTH - Width of overall Table in pixels or percent.

Table Width = 100% Table Width = 100%

tablecode.gif (633 bytes)

		
<table width="100%">
<tr>
<td>Table Width = 100%</td>
<td>Table Width = 100%</td>
</tr>
</table>
Table Width = 400 Table Width = 400

tablecode.gif (633 bytes)

		
<table width="400">
<tr>
<td>Table Width = 400</td>
<td>Table Width = 400</td>
</tr>
</table>

hr1.gif (724 bytes)

HEIGHT - Height of overall Table in pixels or percent.

Table Height = 100 Table Height = 100

tablecode.gif (633 bytes)

		
<table height="100">
<tr>
<td>Table Height = 100</td>
<td>Table Height = 100</td>
</tr>
</table>

hr1.gif (724 bytes)

ALIGN - Aligns the Table to the LEFT, RIGHT, or CENTER of the page.

Align = Left Align = Left
Align = Right Align = Right
Align = Center Align = Center

tablecode.gif (633 bytes)

		
<table align="center">
<tr>
<td>Align = Center</td>
<td>Align = Center</td>
</tr>
</table>

hr1.gif (724 bytes)

BGCOLOR - Specifies the background color of the Table in Hex or color name.

BGCOLOR = "#808080"

tablecode.gif (633 bytes)

		
<table bgcolor="#808080">
<tr>
<td>BGCOLOR = "#808080"</td>
</tr>
</table>

hr1.gif (1127 bytes)

Rows and Columns

As you saw in the Table Source, there are <TR> and <TD> Tags. These are Table Rows and Table Columns. We'll get into the specific commands on seperate pages, but this will give you a simple overview.

Row 1 - Column 1 Row 1 - Column 2 Row 1 - Column 3
Row 2 - Column 1 Row 2 - Column 2 Row 2 - Column 3

tablecode.gif (633 bytes)

		
<table border="1">
<tr>
<td>Row 1 - Column 1</td>
<td>Row 1 - Column 2</td>
<td>Row 1 - Column 3</td>
</tr>
<tr>
<td>Row 2 - Column 1</td>
<td>Row 2 - Column 2</td>
<td>Row 2 - Column 3</td>
</tr>
</table>

The Table has 2 horizontal rows and 3 vertical columns. Each row contains one or more columns before closing the row. The minimum row has 1 column, which would obviously span the width of the table.

1 Row, 1 Column, 1 Border

tablecode.gif (633 bytes)

		
<table border="1">
<tr>
<td>1 Row, 1 Column, 1 Border</td>
</tr>
</table>

hr1.gif (724 bytes)

Captions and Headers

Captions can be a title for a Table. Anything between <CAPTION></CAPTION> will be used as the Caption.

Example:
D.J. Quad's Contact Info
djquad@quadzilla.com

tablecode.gif (633 bytes)

		
<table border="1">
<caption>Example:</caption>
<tr>
<td>D.J. Quad's Contact Info</td>
</tr>
<tr>
<td>djquad@quadzilla.com</td>
</tr>
</table>

The Caption can be aligned TOP or BOTTOM. Internet Explorer supports LEFT and RIGHT also).

Example:
D.J. Quad's Contact Info
djquad@quadzilla.com

tablecode.gif (633 bytes)

		
<table border="1">
<caption align="left">Example:</caption>
<tr><td>D.J. Quad's Contact Info</td></tr>
<tr><td>djquad@quadzilla.com</td></tr>
</table>

hr1.gif (724 bytes)



Up to => Home / Quadzilla / Tables




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers