An HTML table is an element comprised of table rows and columns, much like you'd see when working with an application such as Excel. Tables are container elements, and their sole purpose is to house other HTML elements and arrange them in a tabular fashion -- row by row, column by column.
An HTML table consists of the <table> element and one or more <tr>, <th>, and <td> elements.
The <tr> element defines a table row, the <th> element defines a table header, and the <td> element defines a table cell.
Attributes of Table
. border -- Specifies whether the table cells should have borders or not .
. cellpadding -- Specifies the space between the cell wall and the cell content.
. cellspacing -- Specifies the space between cells .
. width -- Specifies the width of a table .
. height -- Specifies the height of a table .
. bgcolor -- Specifies the background color for a table .
. align -- Specifies the alignment of a table according to surrounding text (left, center, right) .
. bordercolor -- Specifies the border color for a table .
Attributes of TH/TD
. rowspan -- Sets the number of rows a cell should span .
. colspan -- Specifies the number of columns a cell should span .
. bgcolor -- Specifies the background color of a cell .
. width -- Specifies the width of a cell .
. height -- Specifies the height of a cell .
. align -- Aligns the content in a cell (left, right, center, justify)
. valign -- Vertical aligns the content in a cell ( top, middle, bottom, baseline )
USE OF <thead>, <tbody> & <tfoot> :
The <tbody> element is used in conjunction with the <thead> and <tfoot> elements to specify each part of a table (body, header, footer).
These tags specify the Table Header, Table Footer, and Table Body. Basically the top area, bottom area, and main area of the table.
A table may contain only one <thead> and <tfoot> area. It may however contain multiple <tbody> tags.
These three tag sets are a set in themselves. If you are going to use them, you must use all 3 of them in any specific table area. You can't have just a <tbody> or whatever. They are a complete set.