0% found this document useful (0 votes)
61 views

Table Tags in HTML

This document provides an introduction to HTML table tags, including <table>, <caption>, <tr>, and <td>/<th>. It lists the main tags used to define a table, along with their attributes and default values. Some key points covered include that <table> is the container tag used to define a table, <tr> defines table rows, and <td> or <th> are used to add data or headings to columns. Attributes allow styling tables by specifying things like border colors, background colors, cell padding, alignment, and more.

Uploaded by

Satyam Jhawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Table Tags in HTML

This document provides an introduction to HTML table tags, including <table>, <caption>, <tr>, and <td>/<th>. It lists the main tags used to define a table, along with their attributes and default values. Some key points covered include that <table> is the container tag used to define a table, <tr> defines table rows, and <td> or <th> are used to add data or headings to columns. Attributes allow styling tables by specifying things like border colors, background colors, cell padding, alignment, and more.

Uploaded by

Satyam Jhawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

[TABLE TAGS] Introduction to HTML

Sl No. Tag Attribute Attribute Values Default Value Description/Purpose Syntax Type of Tag
1 <table> used to define a table <table>………</table> Container Tag
Border numbers 0 specify the size of the border for the table <table border = "any number">
Bordercolor any color Black specify the color of the border <table bordercolor = "color_name">
cellpadding any number used to add more space inside each cell <table cellpadding = "any number">
cellspacing any number used to add more space around each cell <table cellspacing = "any number">
background set an image as the background of the table <table background = "URL of the image">
bgcolor any color white set a background color to the table <table bgcolor = "color_name">
specifies the width of the table
Width in pixels (%) (Important Note: This attribute is not supported in <table width = "pixels%">
HTML5)

2 <caption> NA defines the caption to a table <caption> Caption to be given </Caption> Container Tag

3 <tr> (Table Row) used to define a table row <tr>…………………………</tr> Container Tag
Bordercolor anycolor black specifies the border color to rows and columns <tr bordercolor = "color_name">

Bgcolor anycolor white specifies the background color to rows and columns <tr bgcolor = "color_name">

Height any number specifies the height of the rows <tr height = "value" >
align left / center / right left specifies the alignment of the cell horizontally <tr align = "choice of alignment">
valign top / middle / bottom bottom specifies the alignment of the cell vertically <tr valign = "choice of alignment">

4 <td>(Table Data) <td>………………………….</td> Container Tag


& used to add data in the table and also specifies the
or
<th>(Table Heading) column
<th>…………………</th>
Bordercolor anycolor black specifies the bordercolor to rows and columns <td/th bordercolor = "color_name">

Bgcolor anycolor white specifies the background color to rows and columns <td/th bgcolor = "color_name">

Height any number specifies the height of the rows <td/th height = "value" >
align left / center / right left specifies the alignment of the cell horizontally <td/th align = "choice of alignment">
valign top / middle / bottom bottom specifies the alignment of the cell vertically <td/th valign = "choice of alignment">
Colspan any number 0 extends the cell horizontally <td/th colspan = "value" >
rowspan any number 0 extends the cell vertictally <td/th rowspan = "value" >

1 Prepared by SATYAM JHAWAR


th
Updated on 29 October, 2020

You might also like