Space between . Why and how can I remove?

后端 未结 5 1060
谎友^
谎友^ 2020-12-10 00:57

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

相关标签:
5条回答
  • 2020-12-10 01:01

    Use cellspacing and cellpadding :

     <table cellspacing="0" cellpadding="0">
    
     </table>
    
    0 讨论(0)
  • 2020-12-10 01:01

    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; 
    }
    
    0 讨论(0)
  • 2020-12-10 01:08

    Could you try this ?

    table#table {
        border-spacing: 0;
    }
    

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

    0 讨论(0)
  • 2020-12-10 01:09

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

    table {
      border-collapse: collapse;
    }
    

    jsfiddle

    0 讨论(0)
  • 2020-12-10 01:19

    Try this answer too

    table.tableclassname td
    {
        display: inline-block;
    }
    
    0 讨论(0)
提交回复
热议问题