KoderSolution Logo
HomeArticlesTutorialsForumAI LabRun Code
KoderSolution Logo

The world’s most advanced technical ecosystem for modern software engineers. Learn, build, and grow with next-generation developer tools and resources.

Engineering Newsletter

Join 100,000+ engineers receiving curated high-signal content weekly.

Platforms

  • Technical Articles
  • Interactive Tutorials
  • AI Coding Lab
  • Developer Forum
  • Developer Tools

Pages

  • About Us
  • Contact Us
  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Disclaimer
  • Advertisement

Popular Topics

  • PHP
  • Laravel
  • Python
  • React.Js
  • MySQL
© 2026 KoderSolutionAll Rights Reserved
Developed Bymaksudur.dev
🌐

HTML

Topic Hub & Articles

HTML HOME

3 min

HTML Introduction

5 min

HTML Editors

10 min

Recap Quiz

5 Questions

HTML Basic

10 min

HTML Elements

10 min

HTML Attributes

10 min

Recap Quiz

5 Questions

HTML Headings

10 min

HTML Styles

10 min

Recap Quiz

5 Questions

HTML Paragraphs

10 min

HTML Formatting

10 min

HTML Quotations

10 min

HTML Comments

10 min

Recap Quiz

5 Questions

HTML Colors

7 min

HTML CSS

10 min

HTML Links

10 min

Recap Quiz

5 Questions

HTML Images

10 min

HTML Favicon

10 min

HTML Page Title

10 min

Recap Quiz

5 Questions

HTML Tables

10 min

HTML Lists

10 min

HTML Block and Inline

10 min

Recap Quiz

5 Questions

HTML Classes

10 min

HTML Id

10 min

HTML Iframes

10 min

Recap Quiz

5 Questions

HTML JavaScript

10 min

HTML File Paths

10 min

HTML Head

10 min

Recap Quiz

5 Questions

HTML Layout

10 min

HTML Responsive

10 min

HTML Computercode

10 min

Recap Quiz

5 Questions

HTML Forms

10 min

HTML Form Attributes

10 min

HTML Form Elements

10 min

Recap Quiz

5 Questions

HTML Input Types

10 min

HTML Input Attributes

10 min

HTML Input Form Attributes

10 min

Recap Quiz

5 Questions

HTML Canvas

10 min

HTML SVG

10 min

HTML Media Intro

10 min

HTML Video

10 min

HTML Audio

10 min

Recap Quiz

5 Questions

HTML YouTube

10 min

HTML Geolocation

10 min

HTML Drag/Drop

10 min

HTML Local Storage

10 min

Recap Quiz

5 Questions

HTML Session Storage

10 min

HTML Web Workers

10 min

HTML SSE

10 min

Recap Quiz

5 Questions

HTML Semantics

10 min

HTML Accessibility

10 min

HTML Entities

10 min

Recap Quiz

5 Questions

HTML Symbols

10 min

HTML Emojis

10 min

HTML Charset

10 min

Recap Quiz

5 Questions

HTML URL Encode

10 min

HTML XHTML

10 min

HTML Global Attributes

10 min

Recap Quiz

5 Questions

HTML Event Attributes

10 min

HTML Color Groups

10 min

HTML URL Paths

10 min

Recap Quiz

5 Questions

HTML Summary

10 min

Progress
0%

0 / 61 Lessons

HTMLHTML Tutorial
Lesson

HTML Tables

10 min reading
Free Course

HTML Tables: Structuring Data with Rows, Columns, and Headers

HTML tables display tabular information such as financial statements, product specifications, pricing plans, and data schedules. You create tables using the <table> element along with table rows (<tr>), table headers (<th>), and table data cells (<td>).

Table Elements and Semantic Structure

HTML tables use semantic container tags to group data rows logically:

<table>
    <caption>Quarterly Revenue Summary</caption>
    <thead>
        <tr>
            <th>Quarter</th>
            <th>Revenue</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Q1 2026</td>
            <td>$45,000</td>
        </tr>
    </tbody>
    <tfoot>
        <tr>
            <td>Total</td>
            <td>$45,000</td>
        </tr>
    </tfoot>
</table>

Core table elements explained:

  1. <table>: The outer wrapper for all tabular contents.
  2. <thead>: Groups header rows containing category names (<th>).
  3. <tbody>: Encloses the main data rows (<tr>) and cells (<td>).
  4. <tfoot>: Contains summary rows (totals, averages, notes).
  5. colspan & rowspan: Attributes used to merge cells across multiple columns or rows.

Table Hierarchy Structure

flowchart TD
    A["table"] --> B["caption (Optional Title)"]
    A --> C["thead (Header Section)"]
    A --> D["tbody (Data Rows Section)"]
    A --> E["tfoot (Summary / Totals Section)"]
    C --> C1["tr -> th (Header Cells)"]
    D --> D1["tr -> td (Data Cells)"]
    E --> E1["tr -> td (Total Cells)"]

Practical Code Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML Tables Demonstration</title>
</head>
<body style="font-family: system-ui, sans-serif; background-color: #0f172a; color: #f8fafc; padding: 2rem;">

    <h2>Pricing Plans Comparison</h2>

    <!-- Styled accessible data table -->
    <table style="width: 100%; border-collapse: collapse; background-color: #1e293b; border-radius: 8px; overflow: hidden;">
        <caption style="padding: 10px; font-weight: bold; color: #38bdf8;">Plan Features Breakdown</caption>
        <thead>
            <tr style="background-color: #334155; text-align: left;">
                <th style="padding: 12px;">Feature</th>
                <th style="padding: 12px;">Starter</th>
                <th style="padding: 12px;">Pro</th>
            </tr>
        </thead>
        <tbody>
            <tr style="border-bottom: 1px solid #334155;">
                <td style="padding: 12px;">Projects</td>
                <td style="padding: 12px;">5</td>
                <td style="padding: 12px;">Unlimited</td>
            </tr>
            <tr style="border-bottom: 1px solid #334155;">
                <td style="padding: 12px;">Storage</td>
                <td style="padding: 12px;">10 GB</td>
                <td style="padding: 12px;">500 GB</td>
            </tr>
        </tbody>
        <tfoot>
            <tr style="background-color: #0f172a; font-weight: bold;">
                <td style="padding: 12px;">Monthly Price</td>
                <td style="padding: 12px;">$9/mo</td>
                <td style="padding: 12px;">$29/mo</td>
            </tr>
        </tfoot>
    </table>

</body>
</html>

Best Practices

  • Never use tables for page layouts: Use Flexbox or CSS Grid for page layouts. Reserve <table> strictly for true 2D grid dataset presentation.
  • Include scope="col" or scope="row" on header cells: Helps screen readers announce table headers clearly when navigating individual data cells.
  • Use border-collapse: collapse in CSS: Prevents awkward double borders between adjacent table cells.

Self-Check Challenge

Create an HTML table listing 3 student names, their exam scores, and a final row merging 2 columns with colspan="2" to display the class average score!

Save Your Progress

Unlock Your
Full Potential.

Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.

Quick Access With

Enterprise-Grade Security Protocol

Recommended Courses & Books

Try it Yourself

Experiment with the code from this lesson in our interactive playground.

Open Playground

Stuck on this lesson?

Join our community of senior developers.

Ask in Forum