HTML Table
- HTML table can allows web developers to arrange data into rows and columns.
- A table in HTML, use the <table> tag. Within this table tag, using the <tr>, <th>, and <td> tags.
- Every table can create between <td> and </td> are the content of the table cell, There are:
- <table> - It establishes a table.
- <tr> - It describes a table row.
- <th> - It defines a table header cell.
- <td> - It describes a table cell.
- <caption> - The caption of the table is defined.
- <colgroup> - It is a collection of one or more table columns for formatting.
- <col> - To provide column properties for each column, use it along with the colgroup element.
- <tbody> - It is used to organise the table's body content.
- <thead> - It is used to organise a table's header information.
- <tfooter> - It is used to organise table footer material.
Example:
<!DOCTYPE
html>
<html>
<body>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Fareen</td>
<td>Sheriff</td>
<td>19</td>
</tr>
<tr>
<td>Roshan</td>
<td>Beevi</td>
<td>20</td>
</tr>
<tr>
<td>pooja</td>
<td>sree</td>
<td>19</td>
</tr>
</table>
</body>
</html>
Output:
HTML Table Cell
- In each table cell can create by <td>....</td> tags.
- The <td> tag stands for table data, are the content of the table cell.
Example:
<!DOCTYPE
html>
<html>
<style>
table,
td {
border: 1px solid black;
}
</style>
<body>
<h2>HTML Table
cells</h2>
<table
style="width: 50%">
<tr>
<td>Python</td>
<td>Java</td>
<td>C++</td>
</tr>
</table>
<p>We can added the
kinds of programming languages to the table.</p>
</body>
</html>
Output:
More topic in HTML