Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html
table
<table>

What is an HTML table?

Educative Answers Team

An HTML table is used for the ​arrangement of data in rows and columns, or possibly in a more complex structure.

svg viewer

Defining tables in HTML

An HTML table is defined with the <table> tag. Following are some basic tags used for specifying the features of a table:

  • <tr> tag is used to define each row in a table.
  • <th> tag is used to define headers of a table.
  • <td> tag is used to define a table data or a cell.

By default, table headings are bold and centered while data is non-bold and left aligned.

Example:

Below is an example of defining a basic HTML table:

For easy reading of the table, line 4-8 are used to add borders to the headers and data cells.

  • HTML

RELATED TAGS

html
table
<table>
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring