Programming Example
Write HTML code for the following Table
This is an example of the HTML table. Visit our tutorial to learn more about HTML table
<table border="1" width="500" height="150" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="6" align="center">Students Information</td>
<td colspan="2" rowspan="2" align="center" valign="bottom">Name</td>
<td colspan="2" align="center">Address</td>
</tr>
<tr>
<td align="left">City</td>
<td align="left">House No</td>
</tr>
<tr>
<td colspan="2" align="center">A</td>
<td align="left">HND</td>
<td align="right">1</td>
</tr>
<tr>
<td colspan="2" align="center">B</td>
<td align="left">LHR</td>
<td align="center">2</td>
</tr>
<tr>
<td colspan="2" align="center">C</td>
<td align="left">SWL</td>
<td align="left">3</td>
</tr>
<tr>
<td colspan="2" align="center">D</td>
<td align="left">BWP</td>
<td align="right">4</td>
</tr>
</table>
<h4>Live Preview </h4>
<div class="box effect2">
<img src="http://www.atnyla.com/library/images-tutorials/html-browser.png" class="img-responsive">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="http://www.atnyla.com/library/html/references/tables/html-table-question-1.html"></iframe>
</div>
</div>
First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.
After understanding this example, try to rewrite the same program without looking at the code. Then change some values or logic and run it again. This helps improve confidence and keeps learners engaged on the page for longer.