Languages
[Edit]
EN

HTML table basic example

6 points
Created by:
Root-ssh
175020

In this article we would like to show you how to create simple HTML table.

Example 1

Run below html code to get table shown on below screenshot:

HTML table basic example

 

Src code:

// ONLINE-RUNNER:browser;

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style>
        table {
            width: 100%;
        }
        table, th, td {
            border: 1px solid black;
            border-collapse: collapse;
        }
        th, td {
            padding: 5px;
            text-align: left;
        }
    </style>
</head>
<body style="height: 180px;">

    <h2>HTML basic table example</h2>

    <table>
        <tr>
            <th>ID</th>
            <th>Username</th>
            <th>User age</th>
        </tr>
        <tr>
            <td>1</td>
            <td>Amy</td>
            <td>25</td>
        </tr>
        <tr>
            <td>2</td>
            <td>Tom</td>
            <td>27</td>
        </tr>
    </table>

</body>
</html>

 

Alternative titles

  1. HTML simple table example
  2. HTML static table example
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

HTML

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join