How to create tables in HTML ? Easy steps guide
Here ,i will explain how to create a table in HTML.
Tags used in HTML to create table are:
<table> </table> = is used to define table
<tr> </tr> = table rows
<th> </th>= table headings
<td> </td>= table data
How to use above tags to create a table in HTML
<table>
<tr>
<th>
students </th>
<th> males
</th>
<th>
females</th>
</tr>
<tr>
<td> 30 </td>
<td> ten
</td>
<td> twenty
</td>
</tr>
<tr>
<td> 40
</td>
<td> 25 </td>
<td> 15 </td>
</tr>
</table>
These codes generate the basic table as shown below :
students
|
males
|
females
|
30
|
10
|
20
|
40
|
25
|
15
|
How to add Caption to your table in HTML :
<caption> </caption> = tag used to add add title
<b> </b>
= bold text
<table>
<caption><b> SCHOOL</b> </caption>
/* here <b> is used to
<tr>
<th>
students </th>
<th> males
</th>
<th>
females</th>
</tr>
<tr>
<td> 30 </td>
<td> ten
</td>
<td> twenty
</td>
</tr>
<tr>
<td> 40
</td>
<td> 25 </td>
<td> 15 </td>
</tr>
</table>
SCHOOL
|
||
students
|
males
|
females
|
30
|
10
|
20
|
40
|
25
|
15
|
0 comments :
Post a Comment