HTML table example


 

HTML table example

In this section we will provide you example of HTML table tag.

In this section we will provide you example of HTML table tag.

HTML Table example

In this page we will learn how to use HTML table tag with the help of examples. HTML table tag is used to display the data into tabular form on the web page.

Here is an example of HTML Table:

Programming/Scripting Lanugage Use
C++ Used to develop many types of applications
PHP PHP is scripting language and mostly used in developing dynamic web applications
Java Used for development of enterprise applications
ASP Programming language from Microsoft for development of dynamic web applications

The above example shows how to use table tag for displaying tabular data on web page.

Here is the code used for creating above table:

<table style="width: 39%" cellspacing="1">

<tr>

<td style="width: 207px"><strong>

Programming/Scripting Lanugage</strong></td>

<td style="width: 209px"><strong>Use</strong></td>

</tr>

<tr>

<td style="width: 207px">C++</td>

<td style="width: 209px">Used to develop many

types of applications</td>

</tr>

<tr>

<td style="width: 207px">PHP</td>

<td style="width: 209px">PHP is scripting

language and mostly used in developing dynamic

web applications</td>

</tr>

<tr>

<td style="width: 207px">Java</td>

<td style="width: 209px">Used for development of

enterprise applications</td>

</tr>

<tr>

<td style="width: 207px">ASP</td>

<td style="width: 209px">Programming language

from Microsoft for development of dynamic web

applications</td>

</tr>

</table>

 

In HTML tables are defined using <table> tag. It contains <tr>..</tr> tag for creating new row and <td>..</td> for creating columns. The <td>...</td> tags are places under <tr>....</tr> tag. Here is simple use of HTML table tag:

<table>
<tr>
    <td>col1</td>
    <td>Col2</td>
</tr>
<tr>
    <td>Col1</td>
    <td>Col2</td>
</tr>
</table>

Table tag is very useful in layout of web page components.

Ads