HTML Tables

HTML tables are used to organize and display data in a structured tabular format. They consist of rows (`<tr>`) and cells (`<td>`) that are contained within a table element (`<table>`). Here's an example of a basic HTML table structure:

html
<table>
    <tr>
        <th>Header 1</th>
        <th>Header 2</th>
        <th>Header 3</th>
    </tr>
    <tr>
        <td>Data 1</td>
        <td>Data 2</td>
        <td>Data 3</td>
    </tr>
    <tr>
        <td>Data 4</td>
        <td>Data 5</td>
        <td>Data 6</td>
    </tr>
</table>

In this example, we have a table with three columns and two rows. The first row contains table headers (`<th>`) which are typically used to label each column. The subsequent rows contain table data cells (`<td>`) which hold the actual data.


Here's a breakdown of the HTML structure:


- The `<table>` element is used to create the table.
- Each row is defined with the `<tr>` element.
- Table headers are defined using the `<th>` element.
- Table data cells are defined using the `<td>` element.


You can add more rows and cells as needed to accommodate your data. Additionally, you can use CSS to style the table, such as setting borders, background colors, and adjusting cell padding, among other styling options.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext