HTML Code for Table

HTML Code for Table


HTML table,table structure,table design,web development,front-end development,HTML,table headers,table rows,table columns,web design.,


 a basic example of an HTML table. This table includes headers, rows, and columns. You can customize the content and structure of the table according to your needs.


HTML

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>HTML Table</title>

    <style>

        table {

            width: 100%;

            border-collapse: collapse;

            margin-top: 20px;

        }


        th, td {

            border: 1px solid #ddd;

            padding: 10px;

            text-align: left;

        }


        th {

            background-color: #f2f2f2;

        }

    </style>

</head>

<body>

    <table>

        <thead>

            <tr>

                <th>Name</th>

                <th>Age</th>

                <th>City</th>

            </tr>

        </thead>

        <tbody>

            <tr>

                <td>John Doe</td>

                <td>25</td>

                <td>New York</td>

            </tr>

            <tr>

                <td>Jane Smith</td>

                <td>30</td>

                <td>San Francisco</td>

            </tr>

            <tr>

                <td>Bob Johnson</td>

                <td>22</td>

                <td>Los Angeles</td>

            </tr>

        </tbody>

    </table>

</body>

</html>


You can modify the content inside the `<thead>` and `<tbody>` sections to match your data. Additionally, you can adjust the styling properties in the `<style>` section to customize the appearance of the table.

Post a Comment

Previous Post Next Post