HTML table basic example

3 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:

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>



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.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé