How to create tables in HTML ? Easy steps guide

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>

this html code will look like this

SCHOOL
students
males
females
30
10
20
40
25
15

Share on Google Plus

About Rahul Rana

I am an experienced web designer and SEO expert. I am running my own online marketing company i.e "SEO To Web Design". Thanks for reading, keep sharing online marketing and web design knowledge.
    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment

Enter your email address:

Delivered by FeedBurner