You get a bonus - 1 coin for daily activity. Now you have 1 coin

2.3. Tables in HTML

Lecture



The <table> element serves as a container for the elements that define the content of a table. Any table consists of rows and cells, which are set using the <tr> and <td> tags. Inside <table> it is permitted to use the following elements: <caption>, <col>, <colgroup>, <tbody>, <td>, <tfoot>, <th>, <thead> and <tr>.

Tables with an invisible border were long used for laying out web pages, allowing a document to be split into modular blocks. This way of using tables took hold on many sites, until it was superseded by the more modern approach of layout using layers.

Syntax

<table>
  <tr>
    <td>...</td>
  </tr>
</table>

Attributes

align
Defines the alignment of the table.
background
Sets a background image for the table.
bgcolor
The background color of the table.
border
The thickness of the border in pixels.
bordercolor
The color of the border.
cellpadding
The gap between the border and the content of a cell.
cellspacing
The distance between cells.
cols
The number of columns in the table.
frame
Tells the browser how to display the borders around the table.
height
The height of the table.
rules
Tells the browser where to display the borders between cells.
summary
A brief description of the table.
width
The width of the table.

Universal attributes and events are also available for this tag.

Closing tag

Required.

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "XML, HTML, DHTML, HTML 5"

Terms: XML, HTML, DHTML, HTML 5