HTML + CSS:自动换行后TD之间不需要的空间

时间:2018-09-27 15:56:12

标签: html css whitespace word-wrap

<table cellpadding="0" cellspacing="0" style="mso-table-lspace:0pt; mso-table-rspace:0pt;border-spacing: 0;border-collapse: collapse;margin: 0 auto;">
  <tr>
    <td valign="top" height="13" style="color: #ff8000;font-weight: normal;vertical-align:top;mso-line-height-rule:exactly;line-height: 18px;">
      &rsaquo;&nbsp;
    </td>
    <td valign="top" height="13" style="font-weight: normal;vertical-align:top;mso-line-height-rule:exactly;line-height: 18px;">
      <a style="padding-left: 10px;color:#4D4D4D;font-family:  Arial, Helvetica, sans-serif;font-weight: bold;font-size: 13px;text-decoration: none;" th:href="${n.desktopUrl}" th:utext="${n.headline}">
				Long long long text which will be wrapped
			</a>
    </td>
    <td valign="top" height="13" style="display: inline;padding-left: 10px;">Button code</td>

  </tr>

结果是: enter image description here

如何在换行后避免此空间?

2 个答案:

答案 0 :(得分:1)

字段是padding-left: 10px元素上的<td>-这就是造成较大差距的原因

答案 1 :(得分:0)

<td valign="top" height="13" style="display: inline;padding-left: 0px;">Button code</td>

padding-left的值设置为0。