Explain Table in HTML with Example: Simple Guide

HTML Tables enable you to display information in rows and columns. They're perfect for showing data like contacts, products, or statistics. Let's delve into understanding HTML tables and see a practical example.

HTML Table
HTML Table

Before we start, remember that tables must be wrapped within the '<table>' tag and rows of data must be within '<tr>' (table row). Column data, or cells, should be in '<td>' (table data) tags.

HTML Basic Tables
HTML Basic Tables

Understanding Table Structure

The basic structure of an HTML table includes four key elements: the table, its rows, its data cells, and its header cells.

HTML Tables Tags Tutorial with Example โ€” TutorialBrain
HTML Tables Tags Tutorial with Example โ€” TutorialBrain

If you want to highlight specific data, use the '<th>' tag for table headers. This element is often used to help screen readers recognize column headers.

Table Headers

๐Ÿงพ How to Create Tables in HTML
๐Ÿงพ How to Create Tables in HTML

Table headers are vertical data labels, usually left-aligned. They define an HTML table's structure.

Here's a simple example of an HTML table with headers:

```html

Name Age Country
John 30 USA
Sarah 25 UK

tables in html table with text and images on the page, which is displayed below
tables in html table with text and images on the page, which is displayed below

```

Table Rows and Data

Rows and data cells can host a variety of content, like formatting and link tags.

Let's modify our previous table to add sample data for each column:

๐Ÿ“Š Combine Table Cells in HTML
๐Ÿ“Š Combine Table Cells in HTML

```html

Name Age Country
John 30 USA
Sarah 25 UK

```

Spanning and Merging Cells

Responsive HTML Table With Rounded Corners
Responsive HTML Table With Rounded Corners
an image of a table with many lines
an image of a table with many lines
HOW TO MERGE TABLE CELLS IN HTML
HOW TO MERGE TABLE CELLS IN HTML
CSS Table Layout
CSS Table Layout
the table borders for different types of text
the table borders for different types of text
Simple Editable Table In HTML Javascript
Simple Editable Table In HTML Javascript
Welcome to SiteRaw
Welcome to SiteRaw
A Detailed Guide to HTML Tables | Simplilearn
A Detailed Guide to HTML Tables | Simplilearn
Top 9 HTML Table Builders to use Free
Top 9 HTML Table Builders to use Free
Tables in HTML
Tables in HTML
an image of a table with numbers and symbols on the top right hand corner that says tables
an image of a table with numbers and symbols on the top right hand corner that says tables
PHP Display CSV File In HTML Table
PHP Display CSV File In HTML Table
a screenshot of a computer screen with the text'html tables'on it
a screenshot of a computer screen with the text'html tables'on it
Sortable Table In HTML Javascript
Sortable Table In HTML Javascript
Javascript CSV To HTML Table
Javascript CSV To HTML Table
an info sheet describing the different types of web pages and how they are used to create them
an info sheet describing the different types of web pages and how they are used to create them
Responsive Table V1 - Free HTML/CSS Table Template 2026 - Colorlib
Responsive Table V1 - Free HTML/CSS Table Template 2026 - Colorlib
Simple Searchable Table In HTML Javascript
Simple Searchable Table In HTML Javascript
Why You Shouldn't Get Caught Using Tables for Web Page Layouts
Why You Shouldn't Get Caught Using Tables for Web Page Layouts
a computer screen with the text html and an image of a web page on it
a computer screen with the text html and an image of a web page on it

You can merge or span cells across multiple rows or columns using the 'colspan' and 'rowspan' attributes.

Let's add a new column for 'Occupation' and merge cells for it:

```html

Name Age Country Occupation
John 30 USA Engineer
Sarah 25 UK

```

Tables can make complex data much more digestible. Practice and experimentation are the keys to mastering them.

Related Articles

Html Tutorial Myanmar Html Tutorial For Absolute Beginners Html Table Tutorialspoint Html Tutorial Replit How To Learn Basic Html Html Gcfglobal Tutorials Www Tutorialspoint Html Index Htm Html Tutorialspoint Full Pdf Html List Tutorialspoint Htmlunit Java Tutorial