- Home
- /
- HTML Tables
HTML Tutorial
INTRODUCTION
HTML BASIC TAGS
INLINE & BLOCK ELEMENTS
HTML LISTS
HTML TABLES
HTML FORMS
HEAD ELEMENTS
HTML MEDIA
MISCELLANEOUS TAGS
- Home
- /
- HTML Tables
HTML Tables
Tables in HTML help organize content into rows and columns. They’re especially useful for displaying structures data like schedules, product features, or contact lists.
Basic Table Structure
A table begin with the table element. Inside it you use rows (tr
), headers (th
), and data calls (td
) to arrange content.
Basic Syntax
Header 1
Header 2
Data 1
Data 2
Key Element Explained
table
: Defines the start and end of the table.tr
: Represents a table row.th
: Represents a header cell (bold and centered by default)td
: Represents a regular data cell.
Basic Example
Name
Age
Arshyan
100
Output
Name | Age |
---|---|
Arshyan | 100 |
Merging Cells: rowspan
and colspan
Sometimes, you may want a cell to stretch multiple rows or columns.
Visual Representation of Rowspan and Colspan

Colspan Example (merge column):
Effect: The first cell in the first-row spans two columns.
Merged Columns
Column 1
Column 2
Rowspan Example (merge row):
Effect: The second cell in the first-row spans two rows.
Row 1, Column 1
Merged Rows
Row 2, Column 1
Conclusion
HTML tables let you display data in a grid layout. By using tr
, th
, td
effectively- and combining them with rowspan
or colspan
when needed-you can create clear, professional data displays. CSS can further enhance the appearance and responsiveness of tour tables.