HTML TABLES INDEX

Table Borders

To get this:

1 2
3 4

Type this:
<TABLE BORDER=1>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Or a table can have a wide border by specifying it's value <BORDER=25> within the <TABLE> tag.

1 2
3 4

By typing it like this:
<TABLE BORDER=25>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Notice the change to the beginning <TABLE> tag

A table can be created without borders that would look like this by specifying <BORDER=0> within the <TABLE> tag.

1 2
3 4

By typing it like this:
<TABLE BORDER=0 
CELLPADDING=25>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Notice the change to the beginning <TABLE> tag

One more example

1 2
3 4

By typing it like this:
<TABLE BORDER=10 
CELLPADDING=25>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Notice the change to the beginning <TABLE> tag

  1. The value specified for border width is in pixels.
  2. Borders are used to separate cell data.
  3. By default, tables do not have lines separating data cells. In order to display lines, you have to include the border attribute.
  4. Column and row data in tables without borders can be difficult to read.
  5. This page was laid out using tables. For an example of how difficult it can be to distinguish between cell data, take a look at the bottom of this page. The four examples from above are displayed without borders.

Captions BGColor


To get this:

1 2
3 4

Type this:
<TABLE BORDER=1>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Or a table can have a wide border by specifying it's value <BORDER=25> within the <TABLE> tag.

1 2
3 4

By typing it like this:
<TABLE BORDER=25>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Notice the change to the beginning <TABLE> tag

A table can be created without borders that would look like this by specifying <BORDER=0> within the <TABLE> tag.

1 2
3 4

By typing it like this:
<TABLE BORDER=0 
CELLPADDING=25>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Notice the change to the beginning <TABLE> tag

One more example

1 2
3 4

By typing it like this:
<TABLE BORDER=10 
CELLPADDING=25>
<TR>
    <TD>1</TD>	<TD>2</TD>
</TR>
<TR>
    <TD>3</TD>  <TD>4</TD>
</TR>

</TABLE>

Notice the change to the beginning <TABLE> tag

Captions BGColor