HTML table basic example

6 points
Created by:

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">
    <meta charset="UTF-8">
        table {
            width: 100%;
        table, th, td {
            border: 1px solid black;
            border-collapse: collapse;
        th, td {
            padding: 5px;
            text-align: left;
<body style="height: 180px;">

    <h2>HTML basic table example</h2>

            <th>User age</th>



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.


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.

❤️💻 🙂