
Tables in HTML :
Table is made up of rows and columns . Intersection of row and columns make cells that can contain either text or image. Table is used to represent data in logical way and readable formate.
The <CAPTION> Tag : The <CAPTION> tag is used to specify a table description and allows you to place caption above and below tables.
Attribute : ALIGN : Top, Bottom, Left, Right.
The <TABLE> Tag : The <TABLE> tag is used to specifies a contained for a table within your document. Inside these tags you can place <TR> <TD> <TH> and <CAPTION> tags.
Attribute of <TABLE> Tag :
- Align : This specifies the alignment of the table with respect to the browser window. Values - left, right & centre.
- Width : This specifies the table width either in terms of pixels or in terms of percentage of the browser window width. If the value of the attribute is not supplied or provided, then the table is determined by the entries of the table cells. Note : By default 1 pixel. If columns contains a very long entry then the browser will wrap it's content to make sure that all columns are visible.
- Border : This attribute specifies the width of the border of the table. If value of border is not seen then table will have no border.
- Cell spacing : This specifies the width of the border between individuals cells of a table & the border of the table itself.
- Cell padding : This specifies the space to be left in pixels between the border of each table cell & their contents.
- Bgcolor : It sets background color for the table.
- Bordercolor : The color of the border of all the table cells can set by using bordercolor attribute.
The Table Row Tag : <TR>
Attribute : ALIGN, BACKGROUND, BGCOLOR, BORDER, BORDERCOLOR.
The Table Heading Tag : <TH>
Attribute : ROWSAPN, COLSPAN
The Table Data Tag : <TD>
Attribute : ALIGN, BACKGROUND, BGCOLOR, BORDER, BORDERCOLOR, ROWSPAN, COLSPAN.
- Rowspan : This will merge the current cell with a specified number of its adjacent cells on the same column. It should have the value larger than one.
- Colspan : This will merge the adjacent cell with the specified number of cells on the same row.
Let us understand with an example :
Programe :
Output :
No comments:
Post a Comment
If you have any doubts regarding this please comment or email us.