在gd的表中的td之间的空白区域

时间:2015-09-06 19:18:17

标签: css gmail html-table whitespace

我有一张桌子,我把它作为html发送到gmail上,但它有空白。我想这是因为gmail。两个td之间有空白区域。 如何删除它?

我的代码是:

 <table>         
            <tr class="empty"><td></td></tr>
            <tr class="empty"><td></td></tr>

            <tr>
              <td colspan="4" style="background-color: #007C66 !important; color:white !important;">
                    Company:
                </td>
                <td colspan="4" style="background-color: #007C66 !important; color:white !important;">
                    Employee:
                </td>
            </tr>
   //other code
   </table>

1 个答案:

答案 0 :(得分:2)

表格中有默认的单元格间距。在表格中设置cellspacing="0"

<table cellspacing="0">         
        <tr class="empty"><td></td></tr>
        <tr class="empty"><td></td></tr>

        <tr>
          <td colspan="4" style="background-color: #007C66 !important; color:white !important;">
                Company:
            </td>
            <td colspan="4" style="background-color: #007C66 !important; color:white !important;">
                Employee:
            </td>
        </tr>//other code
</table>

以下是DEMO