Sunday, October 15, 2017

CLASS 7 - DIFFERENCES BETWEEN COLUMN SPANNING AND ROW SPANNING IN HTML.

What is colspan & rowspan? How we create those things in HTML?

<table>, <tr>, <th>, <td>, cell-spacing, cell-padding, col-span, row-span are used in HTML for padding and spacing in table.

File Name:  "New colspanrowspan.html"

<html>
<head>
<title>HTML TABLE PROGRAM</title>
</head>
<body>
<br/> <br/> <br/>
<table border="1" align="center" cellspacing="0" cellpadding="3">
<tr>
<th rowspan="2" bgcolor="lime">S.No</th>
<th rowspan="2" bgcolor="lime">Name</th>
<th colspan="3" bgcolor="lime">Age</th>
<th rowspan="2" bgcolor="lime">Department</th>
</tr>
<tr>
<th bgcolor="pink">above 18 to 25</th>
<th bgcolor="pink">above 25</th>
<th bgcolor="pink">above 50</th>
</tr>
<tr>
<td>1</td>
<td>Vijay</td>
<td>23</td>
<td>--</td>
<td>--</td>
<td>Consulting</td>
</tr>
<tr>
<td>2</td>
<td>Tom</td>
<td>--</td>
<td>28</td>
<td>--</td>
<td>HR</td>
</tr>
<tr>
<td>3</td>
<td>John</td>
<td>--</td>
<td>--</td>
<td>52</td>
<td>Finance</td>
</tr>
</table>
</body>
</html>

OUTPUT:




 Watch the below video for more details on the above program:




*************************************************************************

No comments:

Post a Comment