0% found this document useful (0 votes)
2 views3 pages

HTML Table

HTML tables are used to organize data into rows and columns, defined by various tags such as <table>, <tr>, <th>, and <td>. The document provides a basic structure for creating a table, including an example of an invoice table with items and prices. Additionally, it lists other relevant HTML table tags for further customization and organization.

Uploaded by

milakshmi034
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

HTML Table

HTML tables are used to organize data into rows and columns, defined by various tags such as <table>, <tr>, <th>, and <td>. The document provides a basic structure for creating a table, including an example of an invoice table with items and prices. Additionally, it lists other relevant HTML table tags for further customization and organization.

Uploaded by

milakshmi034
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HTML Tables

HTML tables allow web developers to arrange data into rows and columns.

Define an HTML Table


The <table> tag defines an HTML table.

Each table row is defined with a <tr> tag. Each table header is defined with
a <th> tag. Each table data/cell is defined with a <td> tag.

By default, the text in <th> elements are bold and centered.

By default, the text in <td> elements are regular and left-aligned.

HTML Table Tags


Tag Description

<table> It defines a table.

<tr> It defines a row in a table.

<th> It defines a header cell in a table.

<td> It defines a cell in a table.

<caption It defines the table caption.


>

<colgroup It specifies a group of one or more columns in a table for


> formatting.

<col> It is used with <colgroup> element to specify column properties for


each column.

<tbody> It is used to group the body content in a table.

<thead> It is used to group the header content in a table.

<tfooter> It is used to group the footer content in a table.


Program to create a Table.

<html>
<head>
<title>Table</title>
</head>
<body>
<table border="1" width="200" height="200">
<caption>Invoice</caption>
<tr>
<th>Sno</th>
<th>Item</th>
<th>Price</th>
</tr>
<tr>
<td>1</td>
<td>Apple</td>
<td>Rs. 20</td>
</tr>
<tr>
<td>2</td>
<td>Mango</td>
<td>Rs. 15</td>
</tr>
<tr>
<td>3</td>
<td>Banana</td>
<td>Rs. 3</td>
</tr>
</table>
</body>
</html>
Output :

Invoice
Sno Item Price
1 Apple Rs. 20
2 Mango Rs. 15
3 Banana Rs. 3

[Link]

[Link]

You might also like