0% found this document useful (0 votes)
39 views65 pages

Day 9

This document provides a comprehensive guide on how to create and style HTML tables using CSS, including adding borders, setting border styles, and adjusting table sizes. It covers various border properties such as solid, dotted, and color, as well as techniques for creating invisible and rounded borders. Additionally, it explains how to set specific widths for tables and columns, with practical examples included throughout.
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)
39 views65 pages

Day 9

This document provides a comprehensive guide on how to create and style HTML tables using CSS, including adding borders, setting border styles, and adjusting table sizes. It covers various border properties such as solid, dotted, and color, as well as techniques for creating invisible and rounded borders. Additionally, it explains how to set specific widths for tables and columns, with practical examples included throughout.
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

HTML - Day 9

HTML 5
HTML Table Borders
HTML tables can have borders of different styles and shapes.

How To Add a Border


To add a border, use the CSS border property on table, th, and td elements:

Example
table, th, td {
border: 1px solid black;
}

Collapsed Table Borders


To avoid having double borders like in the example above, set the CSS border-
collapse property to collapse.

This will make the borders collapse into a single border:

Example
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

Style Table Borders


If you set a background color of each cell, and give the border a white color (the same as
the document background), you get the impression of an invisible border:

Example
table, th, td {
border: 1px solid white;
border-collapse: collapse;
}
th, td {
background-color: #96D4D4;
}

Round Table Borders


With the border-radius property, the borders get rounded corners:

Example
table, th, td {
border: 1px solid black;
border-radius: 10px;
}

Skip the border around the table by leaving out table from the css selector:

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

Example
th, td {
border: 1px solid black;
border-radius: 10px;
}

Dotted Table Borders


With the border-style property, you can set the appearance of the border.

The following values are allowed:

• dotted
• dashed
• solid
• double
• groove
• ridge
• inset
• outset
• none
• hidden

Example
th, td {
border-style: dotted;
}

Border Color
With the border-color property, you can set the color of the border.

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

Example
th, td {
border-color: #96D4D4;
}

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>

<h2>Table With Border</h2>

<p>Use the CSS border property to add a border to the table.</p>

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>

</body>
</html>

Table With Border

Use the CSS border property to add a border to the table.

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Firstname Lastname Age
Jill Smith 50
Eve Jackson 94
John Doe 80

<!DOCTYPE html>

<html>

<head>

<style>

table, th, td {

border: 1px solid black;

border-collapse: collapse;

</style>

</head>

<body>

<h2>Collapsed Borders</h2>

<p>If you want the borders to collapse into one border, add the CSS border-collapse property.</p>

<table style="width:100%">

<tr>

<th>Firstname</th>

<th>Lastname</th>

<th>Age</th>

</tr>

<tr>

<td>Jill</td>

<td>Smith</td>

<td>50</td>

</tr>

<tr>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>Eve</td>

<td>Jackson</td>

<td>94</td>

</tr>

<tr>

<td>John</td>

<td>Doe</td>

<td>80</td>

</tr>

</table>

</body>

</html>

Collapsed Borders

If you want the borders to collapse into one border, add the CSS border-collapse property.

Firstname Lastname Age


Jill Smith 50
Eve Jackson 94
John Doe 80

<!DOCTYPE html>

<html>

<head>

<style>

table, th, td {

border: 1px solid white;

border-collapse: collapse;

th, td {

background-color: #96D4D4;

</style>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
</head>

<body>

<h2>Table With Invisible Borders</h2>

<p>Style the table with white borders and a background color of the cells to make the impression of invisible
borders.</p>

<table style="width:100%">

<tr>

<th>Firstname</th>

<th>Lastname</th>

<th>Age</th>

</tr>

<tr>

<td>Jill</td>

<td>Smith</td>

<td>50</td>

</tr>

<tr>

<td>Eve</td>

<td>Jackson</td>

<td>94</td>

</tr>

<tr>

<td>John</td>

<td>Doe</td>

<td>80</td>

</tr>

</table>

</body>

</html>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Table With Invisible Borders

Style the table with white borders and a background color of the cells to make the impression of
invisible borders.

Firstname Lastname Age


Jill Smith 50
Eve Jackson 94
John Doe 80

Table With Rounded Borders

Use the CSS border-radius property to add rounded corners to the borders.

<!DOCTYPE html>

<html>

<head>

<style>

table, th, td {

border: 1px solid black;

border-radius: 10px;

</style>

</head>

<body>

<h2>Table With Rounded Borders</h2>

<p>Use the CSS border-radius property to add rounded corners to the borders.</p>

<table style="width:100%">

<tr>

<th>Firstname</th>

<th>Lastname</th>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<th>Age</th>

</tr>

<tr>

<td>Jill</td>

<td>Smith</td>

<td>50</td>

</tr>

<tr>

<td>Eve</td>

<td>Jackson</td>

<td>94</td>

</tr>

<tr>

<td>John</td>

<td>Doe</td>

<td>80</td>

</tr>

</table>

</body>

</html>

Table With Rounded Borders

Use the CSS border-radius property to add rounded corners to the table cells.

<!DOCTYPE html>

<html>

<head>

<style>

th, td {

border: 1px solid black;

border-radius: 10px;

</style>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
</head>

<body>

<h2>Table With Rounded Borders</h2>

<p>Use the CSS border-radius property to add rounded corners to the table cells.</p>

<table style="width:100%">

<tr>

<th>Firstname</th>

<th>Lastname</th>

<th>Age</th>

</tr>

<tr>

<td>Jill</td>

<td>Smith</td>

<td>50</td>

</tr>

<tr>

<td>Eve</td>

<td>Jackson</td>

<td>94</td>

</tr>

<tr>

<td>John</td>

<td>Doe</td>

<td>80</td>

</tr>

</table>

</body>

</html>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Table With Dotted Borders

Use the CSS border-style property to set the style of the borders.

Firstname Lastname Age

Jill Smith 50

Eve Jackson 94

John Doe 80

Code:-

<!DOCTYPE html>

<html>

<head>

<style>

th, td {

border-style: dotted;

</style>

</head>

<body>

<h2>Table With Dotted Borders</h2>

<p>Use the CSS border-style property to set the style of the borders.</p>

<table style="width:100%">

<tr>

<th>Firstname</th>

<th>Lastname</th>

<th>Age</th>

</tr>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<tr>

<td>Jill</td>

<td>Smith</td>

<td>50</td>

</tr>

<tr>

<td>Eve</td>

<td>Jackson</td>

<td>94</td>

</tr>

<tr>

<td>John</td>

<td>Doe</td>

<td>80</td>

</tr>

</table>

</body>

</html>

Table With Border Color

Use the CSS border-color property to set the color of the borders.

Firstname Lastname Age


Jill Smith 50
Eve Jackson 94
John Doe 80
<!DOCTYPE html>

<html>

<head>

<style>

th, td {

border-style:solid;
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
border-color: #96D4D4;

</style>

</head>

<body>

<h2>Table With Border Color</h2>

<p>Use the CSS border-color property to set the color of the borders.</p>

<table style="width:100%">

<tr>

<th>Firstname</th>

<th>Lastname</th>

<th>Age</th>

</tr>

<tr>

<td>Jill</td>

<td>Smith</td>

<td>50</td>

</tr>

<tr>

<td>Eve</td>

<td>Jackson</td>

<td>94</td>

</tr>

<tr>

<td>John</td>

<td>Doe</td>

<td>80</td>

</tr>

</table>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

</body>

</html>

HTML Table Sizes


HTML tables can have different sizes for each column, row or the entire table.

Use the style attribute with the width or height properties to specify the size of a
table, row or column.

HTML Table Width


To set the width of a table, add the style attribute to the <table> element:

Example
Set the width of the table to 100%:

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>

<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid black;
border-collapse: collapse;
}
</style>

<body>

<h2>100% wide HTML Table</h2>

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>

</body>
</html>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
100% wide HTML Table
Firstname Lastname Age
Jill Smith 50
Eve Jackson 94
John Doe 80

Note: Using a percentage as the size unit for a width means how wide will this element
be compared to its parent element, which in this case is the <body> element.

HTML Table Column Width

To set the size of a specific column, add the style attribute on a <th> or <td> element:

Example
Set the width of the first column to 70%:

<table style="width:100%">
<tr>
<th style="width:70%">Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>

<!DOCTYPE html>
<html>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<style>
table, th, td {

border:1px solid black;


border-collapse: collapse;
}

</style>

<body>

<h2>Set the first column to 70% of the table width</h2>

<table style="width:100%">

<tr>

<th style="width:70%">Firstname</th>

<th>Lastname</th>
<th>Age</th>

</tr>

<tr>

<td>Jill</td>
<td>Smith</td>

<td>50</td>
</tr>
<tr>

<td>Eve</td>
<td>Jackson</td>
<td>94</td>

</tr>
<tr>

<td>John</td>
<td>Doe</td>
<td>80</td>

</tr>

</table>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

</body>

</html>

Set the first column to 70% of the table width


Firstname Lastname Age

Jill Smith 50

Eve Jackson 94

John Doe 80

HTML Table Row Height

To set the height of a specific row, add the style attribute on a table row element:

Example
Set the height of the second row to 200 pixels:

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr style="height:200px">
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
</tr>
</table>

<!DOCTYPE html>
<html>
<style>

table, th, td {
border:1px solid black;

border-collapse: collapse;
}

</style>

<body>

<h2>Set the height of the second row to 200 pixels</h2>

<table style="width:100%">

<tr>

<th>Firstname</th>

<th>Lastname</th>
<th>Age</th>

</tr>

<tr style="height:200px">

<td>Jill</td>

<td>Smith</td>

<td>50</td>

</tr>

<tr>
<td>Eve</td>

<td>Jackson</td>

<td>94</td>
</tr>

<tr>
<td>John</td>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>Doe</td>
<td>80</td>

</tr>
</table>

</body>

</html>

Set the height of the second row to 200 pixels


Firstname Lastname Age

Jill Smith 50

Eve Jackson 94

John Doe 80

HTML Table Headers


HTML tables can have headers for each column or row, or for many columns/rows.

TOBIAS LINUS
EMIL

8:00

9:00

10:00

11:00

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
12:00

13:00

MON TUE WED THU FRI

8:00

9:00

10:00

11:00

12:00

DECEMBER

HTML Table Headers


Table headers are defined with th elements. Each th element represents a table cell.

Example
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>

<!DOCTYPE html>
<html>
<head>
<style>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>

<h2>Table Headers</h2>

<p>Use the TH element to define table headers.</p>

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>

</body>
</html>
Table Headers

Use the TH element to define table headers.

Firstname Lastname Age


Jill Smith 50
Eve Jackson 94

Vertical Table Headers


To use the first column as table headers, define the first cell in each row as
a <th> element:

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

Example
<table>
<tr>
<th>Firstname</th>
<td>Jill</td>
<td>Eve</td>
</tr>
<tr>
<th>Lastname</th>
<td>Smith</td>
<td>Jackson</td>
</tr>
<tr>
<th>Age</th>
<td>94</td>
<td>50</td>
</tr>
</table>

<!DOCTYPE html>

<html>

<head>

<style>

table, th, td {

border: 1px solid black;


border-collapse: collapse;

</style>
</head>

<body>

<h2>Vertical Table Headers</h2>

<p>The first column becomes table headers if you set the first table cell in each table
row to a TH element:</p>

<table style="width:100%">

<tr>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<th>Firstname</th>
<td>Jill</td>

<td>Eve</td>
</tr>
<tr>

<th>Lastname</th>

<td>Smith</td>
<td>Jackson</td>

</tr>

<tr>

<th>Age</th>

<td>50</td>

<td>94</td>

</tr>
</table>

</body>

</html>

Vertical Table Headers

The first column becomes table headers if you set the first table cell in each table row to a TH
element:

Firstname Jill Eve


Lastname Smith Jackson
Age 50 94

Align Table Headers


By default, table headers are bold and centered:

Firstname Lastname Age

Jill Smith 50

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Eve Jackson 94

To left-align the table headers, use the CSS text-align property:

Example
th {
text-align: left;
}

<!DOCTYPE html>

<html>

<head>

<style>

table, th, td {

border: 1px solid black;


border-collapse: collapse;

th {
text-align: left;

</style>

</head>

<body>

<h2>Left-align Headers</h2>

<p>To left-align the table headers, use the CSS text-align property.</p>

<table style="width:100%">
<tr>

<th>Firstname</th>

<th>Lastname</th>
<th>Age</th>

</tr>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<tr>
<td>Jill</td>

<td>Smith</td>
<td>50</td>
</tr>

<tr>

<td>Eve</td>
<td>Jackson</td>

<td>94</td>

</tr>

</table>

</body>

</html>

Left-align Headers

To left-align the table headers, use the CSS text-align property.

Firstname Lastname Age


Jill Smith 50
Eve Jackson 94

Header for Multiple Columns


You can have a header that spans over two or more columns.

Name Age

Jill Smith 50

Eve Jackson 94

To do this, use the colspan attribute on the <th> element:

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

Example
<table>
<tr>
<th colspan="2">Name</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>

<h2>A header that spans two columns</h2>

<p>Use the colspan attribute to have a header span over multiple columns.</p>

<table style="width:100%">
<tr>
<th colspan="2">Name</th>
<th>Age</th>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
</body>
</html>

A header that spans two columns

Use the colspan attribute to have a header span over multiple columns.

Name Age
Jill Smith 50
Eve Jackson 94

Table Caption
You can add a caption that serves as a heading for the entire table.

Monthly savings

Month Savings

January $100

February $50

To add a caption to a table, use the <caption> tag:

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

Example
<table style="width:100%">
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>

<h2>Table Caption</h2>
<p>To add a caption to a table, use the caption tag.</p>

<table style="width:100%">
<caption>Monthly savings</caption>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>

</body>
</html>

Table Caption

To add a caption to a table, use the caption tag.

Monthly savings
Month Savings
January $100
February $50

HTML Table Padding & Spacing


HTML tables can adjust the padding inside the cells, and also the space between the
cells.

With Padding

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

hello hello hello

hello hello hello

hello hello hello

With Spacing

hello hello hello

hello hello hello

hello hello hello

HTML Table - Cell Padding


Cell padding is the space between the cell edges and the cell content.

By default the padding is set to 0.

To add padding on table cells, use the CSS padding property:

Example
th, td {
padding: 15px;
}

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 15px;
}
</style>
</head>
<body>

<h2>Cellpadding</h2>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<p>Cell padding specifies the space between the cell content and its borders.</p>

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>

<p><strong>Tip:</strong> Try to change the padding to 5px.</p>

</body>
</html>
Cellpadding

Cell padding specifies the space between the cell content and its borders.

Firstname Lastname Age

Jill Smith 50

Eve Jackson 94

John Doe 80

Tip: Try to change the padding to 5px.

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
To add padding only above the content, use the padding-top property.

And the others sides with the padding-bottom, padding-left, and padding-right properties:

Example
th, td {
padding-top: 10px;
padding-bottom: 20px;
padding-left: 30px;
padding-right: 40px;
}

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding-top: 10px;
padding-bottom: 20px;
padding-left: 30px;
padding-right: 40px;
}
</style>
</head>
<body>

<h2>Cellpadding - top - bottom - left - right </h2>


<p>We can specify different padding for all fours sides of the cell content.</p>

<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>Doe</td>
<td>80</td>
</tr>
</table>

</body>
</html>
Cellpadding - top - bottom - left - right

We can specify different padding for all fours sides of the cell content.

Firstname Lastname Age

Jill Smith 50

Eve Jackson 94

John Doe 80

HTML Table - Cell Spacing


Cell spacing is the space between each cell.

By default the space is set to 2 pixels.

To change the space between table cells, use the CSS border-spacing property on
the table element:

Example
table {
border-spacing: 30px;
}

<!DOCTYPE html>

<html>

<head>
<style>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
table, th, td {
border: 1px solid black;

}
table {
border-spacing: 30px;

</style>
</head>

<body>

<h2>Cellspacing</h2>

<p>Change the space between the cells with the border-spacing property.</p>

<table style="width:100%">
<tr>

<th>Firstname</th>

<th>Lastname</th>

<th>Age</th>
</tr>

<tr>
<td>Jill</td>
<td>Smith</td>

<td>50</td>
</tr>
<tr>

<td>Eve</td>
<td>Jackson</td>

<td>94</td>
</tr>
<tr>

<td>John</td>

<td>Doe</td>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>80</td>
</tr>

</table>

</body>

</html>

Cellspacing

Change the space between the cells with the border-spacing property.

HTML Table Colspan & Rowspan


HTML tables can have cells that span over multiple rows and/or columns.

NAME

APRIL

2022

FIESTA

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

HTML Table - Colspan


To make a cell span over multiple columns, use the colspan attribute:

Example
<table>
<tr>
<th colspan="2">Name</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>43</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>57</td>
</tr>
</table>

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>

<h2>Cell that spans two columns</h2>


<p>To make a cell span more than one column, use the colspan attribute.</p>

<table style="width:100%">
<tr>
<th colspan="2">Name</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>43</td>
</tr>
<tr>
<td>Eve</td>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>Jackson</td>
<td>57</td>
</tr>
</table>
</body>
</html>
Cell that spans two columns

To make a cell span more than one column, use the colspan attribute.

Name Age

Jill Smith 43

Eve Jackson 57

Note: The value of the colspan attribute represents the number of columns to span.

HTML Table - Rowspan


To make a cell span over multiple rows, use the rowspan attribute:

Example
<table>
<tr>
<th>Name</th>
<td>Jill</td>
</tr>
<tr>
<th rowspan="2">Phone</th>
<td>555-1234</td>
</tr>
<tr>
<td>555-8745</td>
</tr>
</table>

<!DOCTYPE html>

<html>
<head>
<style>

table, th, td {
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
border: 1px solid black;
border-collapse: collapse;

}
</style>
</head>

<body>

<h2>Cell that spans two rows</h2>

<p>To make a cell span more than one row, use the rowspan attribute.</p>

<table style="width:100%">

<tr>

<th>Name</th>

<td>Jill</td>
</tr>

<tr>

<th rowspan="2">Phone</th>

<td>555-1234</td>
</tr>

<tr>
<td>555-8745</td>
</tr>

</table>
</body>
</html>

Cell that spans two rows

To make a cell span more than one row, use the rowspan attribute.

Name Jill

555-1234
Phone
555-8745

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Note: The value of the rowspan attribute represents the number of rows to span.

HTML Table Styling


Use CSS to make your tables look better.

HTML Table - Zebra Stripes


If you add a background color on every other table row, you will get a nice zebra stripes
effect.

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

17 18 19 20

To style every other table row element, use the :nth-child(even) selector like this:

Example
tr:nth-child(even) {
background-color: #D6EEEE;
}

<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse;
width: 100%;
}

th, td {
text-align: left;
padding: 8px;
}

tr:nth-child(even) {
background-color: #D6EEEE;
}
</style>
</head>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<body>

<h2>Zebra Striped Table</h2>


<p>For zebra-striped tables, use the nth-child() selector and add a background-color to
all even (or odd) table rows:</p>

<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
<td>$100</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
<td>$150</td>
</tr>
<tr>
<td>Joe</td>
<td>Swanson</td>
<td>$300</td>
</tr>
<tr>
<td>Cleveland</td>
<td>Brown</td>
<td>$250</td>
</tr>
</table>

</body>
</html>

Zebra Striped Table

For zebra-striped tables, use the nth-child() selector and add a background-color to all even (or
odd) table rows:

First Name Last Name Points

Peter Griffin $100

Lois Griffin $150

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Joe Swanson $300

Cleveland Brown $250

Note: If you use (odd) instead of (even), the styling will occur on row 1,3,5 etc. instead of
2,4,6 etc.

HTML Table - Vertical Zebra Stripes


To make vertical zebra stripes, style every other column, instead of every other row.

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

17 18 19 20

Set the :nth-child(even) for table data elements like this:

Example
td:nth-child(even), th:nth-child(even) {
background-color: #D6EEEE;
}

<!DOCTYPE html>

<html>

<head>

<style>

table, th, td {

border: 1px solid black;


border-collapse: collapse;

th:nth-child(even),td:nth-child(even) {

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
background-color: #D6EEEE;
}

</style>
</head>
<body>

<h2>Striped Table</h2>

<p>For zebra-striped tables, use the nth-child() selector and add a background-color to
all even (or odd) table rows:</p>

<table style="width:100%">

<tr>

<th>MON</th>

<th>TUE</th>
<th>WED</th>

<th>THU</th>
<th>FRI</th>

<th>SAT</th>

<th>SUN</th>

</tr>
<tr>

<td> </td>
<td> </td>
<td> </td>

<td> </td>

<td> </td>
<td> </td>

<td> </td>

</tr>

<tr>
<td> </td>
<td> </td>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td> </td>
<td> </td>

<td> </td>
<td> </td>
<td> </td>

</tr>

<tr>
<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>
</tr>

<tr>

<td> </td>

<td> </td>
<td> </td>

<td> </td>
<td> </td>
<td> </td>

<td> </td>
</tr>
</table>

</body>

</html>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Striped Table

For zebra-striped tables, use the nth-child() selector and add a background-color to all even (or
odd) table rows:

MON TUE WED THU FRI SAT SUN

Note: Put the :nth-child() selector on both th and td elements if you want to have the
styling on both headers and regular table cells.

Combine Vertical and Horizontal Zebra Stripes


You can combine the styling from the two examples above and you will have stripes on
every other row and every other column.

If you use a transparent color you will get an overlapping effect.

Use an rgba() color to specify the transparency of the color:

Example
tr:nth-child(even) {
background-color: rgba(150, 212, 212, 0.4);
}

th:nth-child(even),td:nth-child(even) {

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
background-color: rgba(150, 212, 212, 0.4);
}

<!DOCTYPE html>
<html>
<head>

<style>
table, th, td {

border: 1px solid black;


border-collapse: collapse;

tr:nth-child(even) {
background-color: rgba(150, 212, 212, 0.4);

th:nth-child(even),td:nth-child(even) {

background-color: rgba(150, 212, 212, 0.4);

}
</style>

</head>

<body>

<h2>Striped Table</h2>

<p>For zebra-striped tables, use the nth-child() selector and add a background-color to
all even (or odd) table rows:</p>

<table style="width:100%">
<tr>
<th>MON</th>

<th>TUE</th>
<th>WED</th>
<th>THU</th>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<th>FRI</th>
<th>SAT</th>

<th>SUN</th>
</tr>
<tr>

<td> </td>

<td> </td>
<td> </td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

</tr>

<tr>
<td> </td>

<td> </td>

<td> </td>

<td> </td>
<td> </td>

<td> </td>
<td> </td>
</tr>

<tr>
<td> </td>
<td> </td>

<td> </td>
<td> </td>

<td> </td>
<td> </td>
<td> </td>

</tr>

<tr>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td> </td>
<td> </td>

<td> </td>
<td> </td>
<td> </td>

<td> </td>

<td> </td>
</tr>

</table>

</body>

</html>

Striped Table

For zebra-striped tables, use the nth-child() selector and add a background-color to all even (or
odd) table rows:

Horizontal Dividers

First Name Last Name Savings

Peter Griffin $100

Lois Griffin $150

Joe Swanson $300

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
If you specify borders only at the bottom of each table row, you will have a table with
horizontal dividers.

Add the border-bottom property to all tr elements to get horizontal dividers:

Example
tr {
border-bottom: 1px solid #ddd;
}

<!DOCTYPE html>

<html>

<head>
<style>
table {

border-collapse: collapse;

width: 100%;

tr {

border-bottom: 1px solid #ddd;

</style>

</head>

<body>

<h2>Bordered Table Dividers</h2>


<p>Add the border-bottom property to the tr elements for horizontal dividers:</p>

<table>
<tr>

<th>Firstname</th>

<th>Lastname</th>
<th>Savings</th>
</tr>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<tr>
<td>Peter</td>

<td>Griffin</td>
<td>$100</td>
</tr>

<tr>

<td>Lois</td>
<td>Griffin</td>

<td>$150</td>

</tr>

<tr>

<td>Joe</td>

<td>Swanson</td>

<td>$300</td>
</tr>

<tr>

<td>Cleveland</td>

<td>Brown</td>
<td>$250</td>

</tr>
</table>

</body>
</html>

Bordered Table Dividers

Add the border-bottom property to the tr elements for horizontal dividers:

Firstname Lastname Savings


Peter Griffin $100
Lois Griffin $150
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
Joe Swanson $300
Cleveland Brown $250

Hoverable Table
Use the :hover selector on tr to highlight table rows on mouse over:

First Name Last Name Savings

Peter Griffin $100

Lois Griffin $150

Joe Swanson $300

Example
tr:hover {background-color: #D6EEEE;}

<!DOCTYPE html>

<html>
<head>

<style>
table {

border-collapse: collapse;

width: 100%;
}

th, td {

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
padding: 8px;
text-align: left;

border-bottom: 1px solid #DDD;


}

tr:hover {background-color: #D6EEEE;}

</style>
</head>

<body>

<h2>Hoverable Table</h2>

<p>Move the mouse over the table rows to see the effect.</p>

<table>
<tr>

<th>First Name</th>

<th>Last Name</th>

<th>Points</th>
</tr>

<tr>
<td>Peter</td>
<td>Griffin</td>

<td>$100</td>
</tr>
<tr>

<td>Lois</td>
<td>Griffin</td>

<td>$150</td>
</tr>
<tr>

<td>Joe</td>

<td>Swanson</td>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>$300</td>
</tr>

<tr>
<td>Cleveland</td>
<td>Brown</td>

<td>$250</td>

</tr>
</table>

</body>

</html>

Hoverable Table

Move the mouse over the table rows to see the effect.

First Name Last Name Points

Peter Griffin $100

Lois Griffin $150

Joe Swanson $300

Cleveland Brown $250

HTML Table Colgroup


The <colgroup> element is used to style specific columns of a table.

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

HTML Table Colgroup


If you want to style the two first columns of a table, use
the <colgroup> and <col> elements.

MON TUE WED THU FRI SAT SUN

1 2 3 4 5 6 7

8 9 10 11 12 13 14

15 16 17 18 19 20 21

22 23 24 25 26 27 28

The <colgroup> element should be used as a container for the column specifications.

Each group is specified with a <col> element.

The span attribute specifies how many columns that get the style.

The style attribute specifies the style to give the columns.

Example
<table>
<colgroup>
<col span="2" style="background-color: #D6EEEE">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
...

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>

<h2>Colgroup</h2>
<p>Add the a colgroup with a col element that spans over two columns to define a style
for the two columns:</p>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9

<table style="width: 100%;">


<colgroup>
<col span="2" style="background-color: #D6EEEE">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
<th>FRI</th>
<th>SAT</th>
<th>SUN</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
<td>26</td>
<td>27</td>
<td>28</td>
</tr>
</table>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
</body>
</html>

Colgroup

Add the a colgroup with a col element that spans over two columns to define a style for the two
columns:

MON TUE WED THU FRI SAT SUN

1 2 3 4 5 6 7

8 9 10 11 12 13 14

15 16 17 18 19 20 21

22 23 24 25 26 27 28

Note: The <colgroup> tag must be a child of a <table> element and should be placed before
any other table elements, like <thead>, <tr>, <td> etc., but after the <caption> element, if
present.

Legal CSS Properties


There is only a very limited selection of CSS properties that are allowed to be used in the
colgroup:

width property
visibility property
background properties
border properties

All other CSS properties will have no effect on your tables.

Multiple Col Elements


If you want to style more columns with different styles, use more <col> elements inside
the <colgroup>:

Example
<table>
<colgroup>
<col span="2" style="background-color: #D6EEEE">

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<col span="3" style="background-color: pink">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
...
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>

<h2>Multiple Col Elements</h2>


<p>Add multiple col elements in the colgroup:</p>

<table style="width: 100%;">


<colgroup>
<col span="2" style="background-color: #D6EEEE">
<col span="3" style="background-color: pink">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
<th>FRI</th>
<th>SAT</th>
RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013
Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<th>SUN</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr>
<td>22</td>
<td>23</td>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>24</td>
<td>25</td>
<td>26</td>
<td>27</td>
<td>28</td>
</tr>
</table>

</body>
</html>

Multiple Col Elements

Add multiple col elements in the colgroup:

MON TUE WED THU FRI SAT SUN

1 2 3 4 5 6 7

8 9 10 11 12 13 14

15 16 17 18 19 20 21

22 23 24 25 26 27 28

Empty Colgroups
If you want to style columns in the middle of a table, insert a "empty" <col> element (with
no styles) for the columns before:

Example
<table>
<colgroup>
<col span="3">
<col span="2" style="background-color: pink">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<th>THU</th>
...
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>

<h2>Empty Colgroups</h2>
<p>Add "empty" col elements that represents the columns before the columns you
want to style:</p>

<table style="width: 100%;">


<colgroup>
<col span="3">
<col span="2" style="background-color: pink">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
<th>FRI</th>
<th>SAT</th>
<th>SUN</th>
</tr>
<tr>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
<td>26</td>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>27</td>
<td>28</td>
</tr>
</table>

</body>
</html>

Empty Colgroups

Add "empty" col elements that represents the columns before the columns you want to style:

MON TUE WED THU FRI SAT SUN

1 2 3 4 5 6 7

8 9 10 11 12 13 14

15 16 17 18 19 20 21

22 23 24 25 26 27 28

Hide Columns
You can hide columns with the visibility: collapse property:

Example
<table>
<colgroup>
<col span="2">
<col span="3" style="visibility: collapse">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
...
<!DOCTYPE html>
<html>
<head>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>

<h2>Hide Columns</h2>
<p>You can hide specific columns with the visibility property:</p>

<table style="width: 100%;">


<colgroup>
<col span="2">
<col span="3" style="visibility: collapse">
</colgroup>
<tr>
<th>MON</th>
<th>TUE</th>
<th>WED</th>
<th>THU</th>
<th>FRI</th>
<th>SAT</th>
<th>SUN</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
<td>26</td>
<td>27</td>
<td>28</td>
</tr>
</table>

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.
HTML - Day 9
<p><b>Note:</b> The table columns does not collapse properly in Safari
browsers.</p>
</body>
</html>

Hide Columns

You can hide specific columns with the visibility property:

MON TUE WED THU FRI SAT SUN

1 2 3 4 5 6 7

8 9 10 11 12 13 14

15 16 17 18 19 20 21

22 23 24 25 26 27 28

Note: The table columns does not collapse properly in Safari browsers.

RAHUL KACHHWAHA, REWA (M.P.) INDIA +91-9993969013


Disclaimer: - This eBook is not for sale only Education Purpose Only.

You might also like