Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

tables
html
communitycreator

How to use tables in HTML

Chinweuba Elijah Azubuike

Overview

Tables are very useful elements in HTML that developers use to structure a website. This shot shows us how to use and implement a table in HTML.

Elements of table

There are multiple elements that make up a full-fledged table.

  • <table>: It defines and wraps everything regarding the table.
  • <thead>: It is the table header.
  • <tr>: It is the table row.
  • <th>: It is the header cell.
  • <tbody>: It is the table body.
  • <td>: It is the table cell.

Let’s now look at how we can structure the table. The following example, alongside comments, would help us with it.

Example

HTML table

Explanation

In line 10 to 32 we start creating table using <table> <\table> tag this table contains two column and one row. <tr> represents the rows and <td> represents the columns . They also have a heading <heading>, which makes by default text appear bold. They also have a body <tbody> to hold the information we want.

RELATED TAGS

tables
html
communitycreator

CONTRIBUTOR

Chinweuba Elijah Azubuike
RELATED COURSES

View all Courses

Keep Exploring