- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Create a table in HTML
The HTML <table> tag is used for defining a table. The table tag contains other tags that define the structure of the table.
The following are the attributes −
Attribute | Value | Description |
---|---|---|
abbr | abbreviated_text | Deprecated − Specifies an abbreviated version of the content in a cell. |
align | right left center justify char | Deprecated − Visual alignment |
bgcolor | rgb(x,x,x) #hexcode colorname | Deprecated − Specifies the background color of the table. |
border | Pixels | Deprecated − Specifies the border width. A value of "0" means no border. |
cellpadding | pixels or % | Deprecated − Specifies the space between the cell borders and their contents. |
cellspacing | pixels or % | Deprecated − Specifies the space between cells. |
frame | void above below hsides lhs rhs vsides box border | Deprecated − Used in conjunction with the border attribute, specifies which side of the frame that makes up the border surrounding the table is displayed. |
rules | none groups rows cols all | Deprecated − Used in conjunction with the border attribute, specifies which rules appear between the cells of the table. |
summary | Text | Deprecated − Specifies the summary of the content. |
width | pixels or % | Deprecated − Specifies the width of the table. |
Example
You can try to run the following code to create a table in HTML −
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <h3>Ranking</h3> <table> <th>Rank</th> <tr> <td>One</td> </tr> <tr> <td>Two</td> </tr> </table> </body> </html>
- Related Articles
- Create caption for a table in HTML?
- How to create table footer in HTML?
- How to create table heading in HTML?
- In HTML how to create table header?
- How to create table header in HTML?
- How to create table border in HTML?
- How to create table rows & columns in HTML?
- INSERT INTO table if a table exists in MySQL else implement CREATE TABLE and create the table
- Create a table in MySQL that matches another table?
- How to create a temporary MySQL table in a SELECT statement without a separate CREATE TABLE?
- Create MySQL query to create a table from an existing table?
- Create a white space in HTML
- Create a selectable list in HTML
- Create a style definition in HTML
- How to create a table in JDBC using another table?

Advertisements