HTML Tables Overview

HTML Tables

1. Table Structure (<table>)

The <table> tag defines an HTML table. A table consists of rows, headers, and data cells.

HTML Example:

<table>
    <caption>Monthly Sales Report</caption>
    <thead>
        <tr>
            <th>Month</th>
            <th>Sales</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>January</td>
            <td>$10,000</td>
        </tr>
        <tr>
            <td>February</td>
            <td>$12,000</td>
        </tr>
    </tbody>
    <tfoot>
        <tr>
            <td>Total</td>
            <td>$22,000</td>
        </tr>
    </tfoot>
</table>

Explanation:

Monthly Sales Report
Month Sales
January $10,000
February $12,000
Total $22,000
Previous Next
Modern Footer