Remove spacing between table cells and rows

前端 未结 11 1742
我寻月下人不归
我寻月下人不归 2021-02-01 12:49

I\'m designing an HTML email template, which forces me to use tables. In the code below, I\'m having trouble (1) removing the spacing below the placeholder image and (2) removin

相关标签:
11条回答
  • 2021-02-01 13:25

    Hi as @andrew mentioned make cellpadding = 0, you still might have some space as you are using table border=1.

    0 讨论(0)
  • 2021-02-01 13:27

    Put display:block on the css for the cell, and valign="top" that should do the trick

    0 讨论(0)
  • 2021-02-01 13:31

    I had a similar problem. This helps me across main email clients. Add:

    • attributes cellpadding="0", cellspacing="0" and border="0" to tables
    • style border-collapse: collapse; to tables
    • styles padding: 0; margin: 0; to each element
    • and styles font-size: 0px; line-height: 0px; to each element which is empty
    0 讨论(0)
  • 2021-02-01 13:31

    Used font-size:0 in parent TD which has the image.

    0 讨论(0)
  • 2021-02-01 13:32

    If you see table class it has border-spacing: 2px; You could override table class in your css and set its border-spacing: 0px!important in table; I did it like

    table {
          border-collapse: separate;
          white-space: normal;
          line-height: normal;
          font-weight: normal;
          font-size: medium;
          font-style: normal;
          color: -internal-quirk-inherit;
          text-align: start;
          border-spacing: 0px!important;
          font-variant: normal;   }
    

    It saved my day.Hope it would be of help. Thanks.

    0 讨论(0)
提交回复
热议问题