Kuba Żukowski
Kuba Żukowski

Reputation: 663

Space between <td>. Why and how can I remove?

I create "normal" table and all TD's have "border: 1px solid #e6e6e6" and "margin: 0". TR and TABLE have too "margin/padding: 0" but I still have space between TDs like here: h

enter image description here

Why? :)

<td></td>

http://jsfiddle.net/VfSdV/

Upvotes: 35

Views: 110271

Answers (7)

khn Rzk
khn Rzk

Reputation: 1282

Cell spacing & Cell padding depreciated instead use border-spacing: 0;

Upvotes: 0

Waseem
Waseem

Reputation: 1

This will work for sure.

table {
  border-collapse: collapse;
}

Upvotes: 0

Etienne Arthur
Etienne Arthur

Reputation: 730

Could you try this ?

table#table {
    border-spacing: 0;
}

This piece of css works for me. Hope it helps :).

Upvotes: 5

Brian Phillips
Brian Phillips

Reputation: 4425

Since cellspacing and cellpadding are no longer supported in HTML5, use the following CSS:

table {
  border-collapse: collapse;
}

jsfiddle

Upvotes: 79

user3378188
user3378188

Reputation: 1

Try this answer too

table.tableclassname td
{
    display: inline-block;
}

Upvotes: -2

CSS2013
CSS2013

Reputation: 131

After much trial and error, I ended up using most of what everyone else mentioned plus some from other sites. This worked for me.

table {
border:0px;
border-collapse:collapse;
border-spacing:0px;
}

td,img { 
padding:0px; 
border-width:0px; 
margin:0px; 
}

Upvotes: 13

Keith
Keith

Reputation: 4147

Use cellspacing and cellpadding :

 <table cellspacing="0" cellpadding="0">

 </table>

Upvotes: 53

Related Questions