Site icon TestingDocs.com

HTML Tables

Overview

We can use the <table> tag to display HTML Tables in web pages. A table is an organized structure to display data in the form of rows and columns.

Syntax

Start tag: <table>
End tag : </table>

The <table> tag defines the beginning of the table. The </table> tag defines the end of the table.

Table Row

<tr>
</tr>

Table row <tr> defines the beginning of the row and </tr> end of the row.

Table Cell

<td>
</td>

A table cell defines an individual cell. Table cells are always placed inside a table row. Table cell <td> defines the beginning of the cell and </td> end of the cell.

Example

<html>
<!–
####################################
# HTML Table Display Demo                                       #
# www.TestingDocs.com                                               #
####################################
–>
<head>
<title> HTML Tutorials – HTML Table Tag Demo</title>
</head>

<body>
<h1> HTML Table </h1>

<p>
Display a sample HTML Table:
</p>

<table border=”3″>
<tr>
<td> Subjects </td>
<td> Marks </td>
<td> Pass/Fail? </td>
</tr>

<tr>
<td> Mathematics </td>
<td> 90 </td>
<td> Pass </td>
</tr>
<tr>
<td> Physics </td>
<td> 74 </td>
<td> Pass </td>
</tr>
<tr>
<td> Chemistry </td>
<td> 68 </td>
<td> Pass </td>
</tr>
</table>

<p>
<h2>
HTML Tutorials – www.TestingDocs.com
</h2>
</p>

</body>
</html>

Sample Output

 

HTML Tutorials

HTML Tutorials on this website:

https://www.testingdocs.com/html-tutorials/

More Information on HTML:

https://www.w3.org/TR/html401/intro/intro.html

Exit mobile version