Advertisements
Advertisements
प्रश्न
Explain the attributes used with <table> tag in HTML.
थोडक्यात उत्तर
उत्तर
The <table> is a container tag. There are several attributes to improve the layout of the table.
They are listed below:
- Cellspacing- It is used to set the space between cells in a table. The value should be in pixels.
- Celipadding- It is used to set the space between the contents of a cell and its border, the value should be in pixels.
- Border- Border attribute with <table> tag is used to specify the thickness of the border lines around the table. The value of the border attribute should be a non zero value in pixels. If its value is zero, HTML displays the table without a border. The default value is Zero in most browsers.
- Bordercolor- It is used to apply the colour to the border lines.
- Align- It is used to set the position of the table within the browser window. Left is the default position. Right or center may be the value of align attribute.
- BGcolor- It is used to apply background colour to the table.
- Height and Width- These two attributes are used to specify the height and width of a table in terms of pixels or percentage.
An HTML code to demonstrate the attributes of Table
<html>
<head>
<title> Table with Attribute </title>
</head>
<body>
<table cellspacing=5
cellpadding=15 border=4
bordercolor=blue align=center
bgcolor=yellow>
<TR>
<TH> Class </TH>
<TH> Boys </TH>
<TH> Girls </TH>
</TR>
<TR>
<TD> VI </TD>
<TD> 150 </TD>
<TD> 165 </TD>
</TR>
<TR>
<TD> VII </TD>
<TD> 146 </TD>
<TD> 151 </TD>
</TR>
<TR>
<TD> VIII </TD>
<TD> 107 </TD>
<TD> 110 </TD>
</TR>
</table>
</body>
</html>
The OUTPUT will be:
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?