HTML < TABLE > TAG
HTML allows to groupe data in the tables. To insert tables on web pages is a need for the following tags:
<table> ...</ table> - generates table (without rows and columns) ;
<tr> ...</ tr> - turn generates a table ;
<td> ... </ td> - generates a table cell ;
Tables have the following attributes to be created:
width = "300" - indicates the width of a table or cell (in pixels or as a percentage of page width) ;
align = "center" - indicates how to align the table (possible values - left, right, center) ;
border = "1" - indicates border table width (0 - without BORDER) ;
bordercolor =
"#EB0000" - indicates border color;
cellspacing =
"0" - indicates the amount of space between cells (0 - no space) ;
cellpadding =
"3" - indicates the amount of space between cells (0 - no space) ;
bgcolor =
"#cccccc" - indicates the background color table, row or cell ;
colspan = "2" - indicates that a cell can be over 2 or more columns ;
rowspan = "2" - indicates that a cell can be over 2 or more lines ;
Example:
To generate the table below was used the following code:
|
Column1
|
Column2
|
Column3
|
|
Content 1
|
Content 2
|
Description
|
<table width="413" border="1" cellpadding="0" cellspacing="0" bordercolor="#3366FF">
<tr>
<td width="99" bgcolor="#33CCFF"><div align="center">Column1</div></td>
<td width="96" bgcolor="#33CCFF"><div align="center">Column2</div></td>
<td width="210" bgcolor="#33CCFF"><div align="center">Column3</div></td>
</tr>
<tr>
<td><div align="center">Content 1 </div></td>
<td><div align="center">Content 2 </div></td>
<td> <div align="center">Description </div></td>
</tr>
</table>