Creating tables

To change the properties of the table and used a set of parameters that are added to the tag <TABLE>. General syntax.

<Table parameter1 = "..." parameter2 = "...">

Description of the table of parameters and their values ​​are given in Table. 1.

Table. 1. Parameters tag <TABLE>
Property Value Description Example
align left
right
center
Alignment table. <Table align = "center">
background URL It defines the image to be used as a background pattern table. <Table background = "pic.gif">
bgcolor
#rrggbb The background color of the table. <Table bgcolor = "# ff9900">
border n The thickness of the frame in pixels. <Table border = "2">
cellpadding n The distance between the cell and its contents. <Table cellpadding = "7">
cellspacing n The distance between the cells. <Table cellspacing = "3">
cols n Specifies the number of columns in the table, helping the browser in preparation for its display. <Table cols = "3">
nowrap Prevents line wrapping in the text. <Table nowrap>
frame
void
above
below
lhs
rhs
hsides
vsides
box
Specifying the type of table frame <Table frame = "hsides">
rules all
groups
cols
none
rows
It specifies where to draw the boundaries between cells. <Table rules = "cols">
width n
n%
The minimum width of the table can be set in pixels or percentages. <Table width = "90%">

Note

  • Table, unless otherwise stated, are always aligned left.
  • By default, the table is displayed without a frame.
  • If the table width is not specified, it is to fit the contents of the cells.
  • It is possible that unnecessary empty spaces arise between table cells. This is due to the fact that the transfer of HTML code in lines automatically and creates extra space in the table. To get rid of this, place the code inside the <TR> tag in one line.

© Policy Copyright www.htmlbook.ru