This document contains the most commonly used tags for table creation in HTML and its associated attributes.Attributes are used to describe the properties of HTML elements and that are specified within the elements opening tag.At last this document will discuss some of the example programs which demonstrates different attributes of various tags. I hope this will help you a lot.
2. TABLES
• Data items represented with the use of rows and columns are
called table.
• The HTML table allow Web authors to arrange data like text,
images and links into rows and columns of cells.
• A table has different parts such as rows, columns, heading and
captions.
• Most important tags related to table creation are
• <TABLE>……………………….</TABLE>
• <CAPTION>……………………</CAPTION>
• <TR>……………………………</TR>
• <TH>……………………………</TH>
• <TD>……………………………</TD>
3. <table> tag
• <table> tag is used to create tables in HTML.
• Attributes are
1. align – Specifies the alignment.
2. background – Specifies the image to be displayed in
the background of table.
3. bgcolor – Specifies the background color.
4. border – Specifies the border width.
5. bordercolor – Specifies the border color.
6. cellpadding – Specifies the space between the cell
borders and their contents.
7. cellspacing – Specifies the space between cells.
8. height – Specifies the table height.
9. width – Specifies the table width.
4. <caption> tag
The <caption> tag defines
the table caption.
The <caption> tag appear
within <table> tag.
It has only one attribute
ALIGN.
5. <tr> tag
• <tr> tag is used for specifying a table row.
• Any special formatting can be done by including
appropriate formatting tags inside <tr> tag.
• An image can also be displayed in a data cell.
• Attributes are
1. align – specifies the visual alignment.
2. bgcolor – Specifies the background color of the table
cell.
6. <td> tag
• <td> tag is used for specifying a table data within a table.
• The text in <td> elements are regular & left-aligned by default.
• Attributes are
1. align – Visual alignment.
2. bgcolor – specifies the background color.
3. bordercolor – Specifies the border color.
4. height – Specifies the height of the cell.
5. width – Specifies the width of the cell.
6. colspan – Specifies the number of columns the current
cell spans across.
7. rowspan – Specifies the number of rows the current cell
span across.
7. <th> tag
• <th> tag is used for specifing the header cell in an
HTML table.
• The text in <th> elements are bold & centered by default.
• Attributes are
1. colspan – Specifies the number of columns a header
cell can span.
2. rowspan – Specifies the number of rows a header cell
can span.
3. scope – Specifies whether a header cell is a header for
a column, row or group of rows or column.