Tuesday, 17 December 2013

HTML tables:

In real time applications,user may want to  prepare applicant details,Employee details, Student report card, and so on.These application would be effective,if they are in a tabular format.If these applications are to be presented in a web page,it can be done with HTML.

HTML provides the choice for the user to create tables.To create a table in HTML, <table> tag is used.Usually,application such as microsoft word, staroffice writer will display the details of first row as bold,when the data is in presented in a tabular format.

Similarly,browsers make the text which is present between the tag <th> as bold.Hence,in HTML we may use the tag for heading purpose.A table is divided into rows by <tr> tag and each row is divided into cells by <td> tags.

Example:
<th>HEADING</th>
<tr>FIRST ROW</tr>
<td>FIRST CELL</td>

Sample code to create a table in web page:

<html>
<head>
<title>Sample</title>
<body>
<table border = "  1 "  >
<tr>
<th>Date</th>
<th>Day</th>
</tr>
<tr>
<td>1/1/2014</td>
<td>Wednesday</td>
</tr>
<tr>
<td>2/1/2014</td>
<td>Thursday</td>
</tr>
<tr>
<td>3/1/2014</td>
<td>Friday</td>
</tr>
<tr>
<td>4/1/2014</td>
<td>Saturday</td>
</tr>
<tr>
<td>5/1/2014</td>
<td>Sunday</td>
</tr>
</tr>
</table>
</body>
</html>

Sample output:

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Technology Unleashed - Powered by Blogger - Designed by Dhilipkumar -