HTML TABLE
HTML
Tables
With HTML you can create tables. In most
applications, a table is commonly used to present tabular information such as
schedules, statistics, calendars, etc. In the world of HTML, a table is also
used for these purposes, but it is more commonly used for organizing the
content of complex web pages. Many web designers prefer to create on overall
web site layout through the use of a single table. A table lets web designers
make use of rows and columns so they can specify precisely where text, images,
and objects are to be placed within their documents. This is what makes the
<table> element one of the most powerful and versatile of all HTML tags.
The following gives an overview of the elements and attributes that may be used
with the <table> tag:
Table
Elements and Corresponding Attributes
<table> </table>
align=""
[left, center, right] |
-
specifies the horizontal alignment of the table. |
border="#"
|
-
specifies the thickness of the table border in pixels represented by #. 0 =
no border; 1 = default; the higher the number, the thicker the border. |
cellpadding="#"
|
- specifies
the thickness of the area inside the contents of a cell in pixels represented
by #; the higher the number, the thicker the area. |
cellspacing="#"
|
-
specifies the thickness of the area outside the contents of a cell in pixels
represented by #; the higher the number, the thicker the area. |
width="#"
|
-
specifies the width of the table in pixels represented by #. Use pixel values
such as width="500" or use percentage values such as
width="100%". Percentages are based on the screen resolution of the
visitor's display. |
bgcolor="#hexValue"
|
-
specifies the color of the background of the table; must use hexadecimal HTML
color values as usual. |
background="imageURL"
|
-
specifies an image to be used as the background of the table; image must be
present in current directory as usual unless full path of image is provided. |
The following tags must be placed within the
beginning and closing <table> </table> tag in order for them to be
associated with the table. Tables are defined with the <table> tag. A
table is divided into rows (with the <tr> tag), and each row is divided
into data cells (with the <td> tag). The letters td stands for
"table data," which is the content of a data cell. A data cell can
contain text, images, lists, paragraphs, forms, horizontal rules, tables, etc.
<table border="1"> <tr>
Example
<td>row 1, cell 1</td>
<td>row
1, cell 2</td> </tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td> </tr>
</table>
Comments