g
Printer Friendly Version

editor  
BellaOnline's HTML Editor
 

The HTML Table - 2

Attributes for the table tag:

<table border="1" bordercolor="#00c000" cellpadding="10"
width="100"> </table>
borderWith the border attribute you can set the thickness of the border/walls for the table. You specify the size by setting the value of the border attribute in pixels or percentage. If you don't want a border to be visible on the webpage you would then set the value to zero.
(border="0")
bordercolorThe bordercolor attribute sets the color for the border of the table. You specify the color by setting the value of the bordercolor attribute to a hexadecimal color code. You can also use color names such as red, blue, and yellow but this is being phased out. Note that some older browsers, especially Netscape browsers, will use the default gray border color.
cellpadding You will use the cellpadding attribute to force a space between the walls of the table cell (box) and the contents within the box.
widthThe width attribute controls the width of the table in pixels or percentage. For example, you can have a table 100 pixels wide (width="100") or 30% of the width of the webpage (width="30%").
Note--The arrow indicates that the code is wrapped to a second line and should really be all on one line.



Attribute for the tr (table row) tag.

<tr bgcolor="#c00000"></tr>
bgcolorYou will use the bgcolor attribute to control the color of the background for each row. You should use the hexadecimal color codes, the color names are being phased out. If you have more than one row in your table, each individual row can be given a different value for this attribute.


Attributes for the td (table data or table cell) tag

<td bgcolor="#000000" align="left" valign="top"
background="image.gif" width="25%" height="200"></td>
bgcolorYou will use the bgcolor attribute to control the color of the background for each cell. You should use the hexadecimal color codes, the color names are being phased out. Each individual cell can be given a different value for this attribute.
alignThe align attribute controls the horizontal alignment of the contents within each cell. You can force the contents to be aligned to the left side, right side, or centered. Each individual cell can be given a different value for this attribute.
valign The valign attribute controls the vertical alignment of the contents in a cell. (top, middle, bottom) Each individual cell can be given a different value for this attribute.
backgroundThe background attribute controls what image is to be placed as the background of a cell. This is not the same as being placed as contents within a cell. This image will be behind the contents within the cell. The value for this attribute is the url for the image. Each individual cell can be given a different value for this attribute.
widthThe width attribute controls the width of the cell in pixels or percentage. For example, you can have a cell 100 pixels wide (width="100") or 30% of the width of the table (width="30%").
heightThe height attribute controls the height of the cell in pixels.
Note--The arrow indicates that the code is wrapped to a second line and should really be all on one line.

← Back | Next →

|


This site needs an editor - click to learn more!

HTML Site @ BellaOnline
View This Article in Regular Layout

Content copyright © 2013 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Editor Wanted for details.



| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2023 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor