HTML TABLES

An HTML table consists of one <table> element and one or more <tr>, <th>, and <td> elements.

An HTML table may also contain <caption>, <colgroup>, <thead>, <tfoot>, and <tbody> elements.

A table with 2 rows and 2 columns

table

Output

DOWNLOAD LATEST PROJECTS

Some of table elements and attributes

TABLES

USE

<tr>

Create Table rows

<td>

Create data cells

<th>

Table heading

<caption>

Title for the table

Cellpadding

Specifies distance between cell boder and content within a cell

Cellspacing

Specifies width of the border

Colspan

Merge 2 or more columns into single column

Rowspan

Merge 2 or more rows

bgcolor

background color for the table

background

set the background image for the table