Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Table cellspacing or padding just top / bottom

Can you have cellpadding or spacing just on the top/ bottom as opposed to all (T, B, L, R) ?

like image 510
leora Avatar asked Dec 27 '08 05:12

leora


People also ask

What is the difference between Cellspacing and cellpadding in HTML?

The cell padding attribute places spacing around data within each cell. The cell spacing attribute places space around each cell in the table.

How do you change the cell spacing in a table in HTML?

The HTML <table> cellspacing Attribute is used to specify the space between the cells. The cellspacing attribute is set in terms of pixels. Attribute Values: pixels: It sets the space between the cells in terms of pixels.

Is Cellspacing deprecated?

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.

How do you give Cellspacing and cellpadding in a table in HTML?

Cell padding is the space between cell borders and the content within a cell. To set cell padding in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <table> tag, with the CSS property padding.


2 Answers

CSS?

td {   padding-top: 2px;   padding-bottom: 2px; } 
like image 169
TRF Avatar answered Sep 23 '22 23:09

TRF


There is css:

table { border-spacing: 40px 10px; } 

for 40px wide and 10px high

like image 43
Nathan Moos Avatar answered Sep 25 '22 23:09

Nathan Moos