HTML ROWSPAN COLSPAN WITH EXAMPLE
HTML ROW ROWSPAN,COL COLSPAN EXAMPLE
HTML Tables are used to display tabular data form in html. HTML Table is defined with the <table> tag and then table row <tr> and cells <td> or <th>. Table tag is the parent of table. Table is a set of rows column and have rows, data, captions, rowgroup, rows, colgroup, cols, etc.
Colspan Attribute
Colspan attribute is used to merge two or more columns in one. Thus we can have rows with different columns. Minimum value for colspan is 2 and default value is 1.
Rowspan Attribute
Rowspan attribute can merge two more rows in a table. Default value of rowspan is 1, and minimum assigned value of rowspan is 2.
Example :
<html>
<head>
<title>Aastha Computer Education</title>
</head>
<body>
<div align="center">
<table border=2 cellpadding=5 cellspacing=5
bgcolor="pink">
<tr bgcolor="green"><th
colspan=8>Aastha Computer Education Mehatpur</th></tr>
<tr bgcolor="green">
<th colspan=2>software</th>
<th colspan=2>hardware</th>
<th colspan=2>application</th>
<th colspan=2>language</th>
</tr>
<tr>
<th rowspan=4
bgcolor="green">c<br>o<br>m<br>p<br>u<br>t<br>e<br>r</th>
<th>account</th>
<th>photoshop</th>
<th>word</th>
<th>excel</th>
<th>multimedia</th>
<th>sap</th>
<th rowspan=4
bgcolor="green">e<br>d<br>u<br>c<br>a<br>t<br>i<br>o<br>n</th></tr>
<tr><th>account</th>
<th>photoshop</th>
<th>word</th>
<th>excel</th>
<th>multimedia</th>
<th>sap</th>
</tr>
<tr>
<th>account</th>
<th>photoshop</th>
<th>word</th>
<th>excel</th>
<th>multimedia</th>
<th>sap</th>
</tr>
<tr
bgcolor="green"><th colspan=6>near canara bank
mehatpur,distt & teh una</th></tr>
</table>
</body>
</html>
The Output Of The Above Code :
Post a Comment