Cellspacing Table html

Cellspacing Table Html Change the space between the cells with the border-spacing property.

Cellspacing Table Html Change the space between the cells with the border-spacing property.


What is a Cellspacing in HTML?


The HTML cells spacing attribute aims to set the spacing between table cells. HTML cell spacing attribute supports table element. The type of value of the HTML cell spacing attribute is pixel, percent, or multilength(i.e. relative length). A length in pixels, percent, or a relative length.

How do you make Cellspacing in HTML5?

The cell-spacing attribute of <table> is not supported in HTML5. The cell spacing attribute specifies the space, in pixels, between cells.


Note: Do not confuse this with the cell padding attribute, which specifies the space between the cell wall and the cell content.

How do you use Cellspacing?

Image result
The cell padding is used to define the spaces between the cells and Their border. 
If the cell padding property is not applied then it will be set as the default value. The cell spacing is used to define the space between the cells.

 Code Example:

 


Output:

Cellspacing

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

Firstname Lastname Age
Jill Smith 50
Eve Jackson 94
John Doe 80



Controlling the Space Between Table Cells

The cellspacing attribute was used to control the amount of space between cells of a table. This attribute has been deprecated, and if you want to add space between table cells you can do so with CSS. The cellspacing attribute, which was used to add space between table data cells, should not be confused with the cellpadding attribute, which was used to add space between the contents of a data cell and the edge of the cell. If you want to add space between table cells with CSS, you can do so with the border-spacing property.

table.example-table{border-spacing: 30px; border-collapse: separate;}

Code Example:



Output:

First columnSecond columnThird column
First columnSecond columnThird column
First columnSecond columnThird column

Comments :

Post a Comment