Tutorials HTML HTML Tables
Ch 9 / 21 ← Prev Next →
Chapter 9 Beginner 9 min read Core Elements

HTML Tables

HTML tables display tabular data in rows and columns using a structured set of tags.

🎯 What you'll learn
Create tables with <table>, <tr>, <td>
Add headers with <th>
Use <thead>, <tbody>, <tfoot>
Span cells with colspan and rowspan
🚀
Sponsored
Learn Full-Stack Development — Join K2 Courses
Live mentoring · Real projects · Placement support · Certificate
Enroll Free
Advertisement
Google Ad — 728×90 Leaderboard

Introduction to HTML Tables

This chapter covers HTML Tables in depth. Understanding this topic is essential for writing clean, modern HTML. Use the live editor below to experiment as you read.

💡 In This Chapter
You will see real code examples, clear explanations, and a live editor to practice immediately — no setup needed.

Basic Table

Core table markup.

HTML
<table>
  <thead>
    <tr><th>Name</th><th>Age</th></tr>
  </thead>
  <tbody>
    <tr><td>Alice</td><td>22</td></tr>
  </tbody>
</table>

Colspan

Span multiple columns.

HTML
<td colspan="2">Spans 2 columns</td>

Try It Yourself

Edit the code below and click ▶ Run to see your changes live.

Live Editor
✎ Editor
👁 Preview
Quick Check — Chapter 9

Which tag defines a table header cell?

📄 Chapter Summary
  • Create tables with <table>, <tr>, <td>
  • Add headers with <th>
  • Use <thead>, <tbody>, <tfoot>
  • Span cells with colspan and rowspan
💡
Sponsored
Master CSS — The Next Step After HTML
56 chapters · Flexbox, Grid, Animations · Free to start
Start CSS →
Advertisement
Google Ad — 300×250 Medium Rectangle
Join WhatsApp Channel