html - 列左侧的填充或边距

标签 html css

我正在为电子邮件制作一些表格。我有 4 列:Example. .我需要左边的红色背景色才能到达左边界。目前有空白、填充或边距。我没有任何自定义 CSS,只有框架。我一直在检查器窗口中查看,但无法弄清楚是什么导致出现空白?

Fiddle

<!-- Wrapper for the body of the email -->
  <table class="body" data-made-with-foundation>
    <tr>
      <!-- The class, align, and <center> tag center the container -->
      <td class="float-center" align="center" valign="top">
        <center>
          <table align="center" class="container">
            <tbody>
              <tr>
                <td>
                  <table class="row">
                    <tbody>
                      <tr>
                        <th class="small-12 large-4 columns first">
                          <table style="width:20%; background-color:red;border: 1px solid black;">
                            <tr>
                              <th>
                                <p class="text-left">Column 1</p>
                              </th>
                            </tr>
                          </table>
                        </th>
                        <th class="small-12 large-4 columns first">
                          <table>
                            <tr>
                              <th>
                                <p class="text-left">Column 2</p>
                              </th>
                            </tr>
                          </table>
                        </th>
                        <th class="small-12 large-4 columns first">
                          <table>
                            <tr>
                              <th>
                                <p class="text-left">Column 3</p>
                              </th>
                            </tr>
                          </table>
                        </th>
                        <th class="small-12 large-4 columns first">
                          <table>
                            <tr>
                              <th>
                                <p class="text-left">Column 4</p>
                              </th>
                            </tr>
                          </table>
                        </th>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>
            </tbody>
          </table>
        </center>
      </td>
    </tr>
  </table>

最佳答案

这些导致了空白 :)

td.large-4.first, th.large-4.first {
      padding-left: 16px;
}
td.large-4, th.large-4 {
      width: 177.33333px;
      padding-left: 8px;
      padding-right: 8px;
}
th.columns, th.column {
     margin: 0 auto;
     Margin: 0 auto;
     padding-left: 16px;
     padding-bottom: 16px;
}

关于html - 列左侧的填充或边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42044776/

相关文章:

javascript - 在由 javascript 加载的图像上添加文本

javascript - 简单的js框架,DOM。 (模块风格,试图让它像 jQuery 风格)

html - Bootstrap 导航栏右对齐将元素向左推

javascript - 划线/删除线样式

javascript - 使段落 Prop 中的某些文本在 react 中加粗的最佳方法是什么?

java - 如何将图像嵌入到模板 HTML Velocity 中?

css - 设置 div padding z-index

javascript - 按元素名称过滤表

html - 将按钮放在内联 block div 旁边

html - 为什么我的伪表不使用 colspan 填充行?