简体   繁体   English

文字间距表格储存格

[英]Text spacing table cell

I have created a table in html for an email (FYI this is not for spam, it's to be used internally at the organization I work for). 我已经在html中为电子邮件创建了一个表(仅供参考,这不是垃圾邮件,它在我工作的组织内部使用)。 CSS is pretty much out of the question since we use Outlook and Office 2007 (which will not render the CSS properly - nothing worked on that front). 由于我们使用的是Outlook和Office 2007(CSS无法正确呈现CSS,因此在这方面没有任何效果),因此CSS几乎是不可能的。 I have 2 cells side by side - one has a background image with text over top, the other has a ttile using an h1 tag I created. 我有2个并排的单元格-一个单元格的背景图像上方带有文本,另一个单元格使用我创建的h1标签进行平铺。

The issue: when I input a 2-lined title in the cell adjacent to the one with the background pic, the spacing at the botttom is so large the background picture duplicates part of it vertically (even though the text in the adjacent cell is not larger than the pic). 问题:当我在与背景图片相邻的单元格中输入两行标题时,底部的间距太大,背景图片会垂直复制一部分(即使相邻单元格中的文本不是比图片大)。 I have tried to specify the padding, but it doesn't change anything. 我试图指定填充,但没有任何改变。

My rule for the h1 tag looks like this: 我对h1标签的规则如下所示:

td.leftCol h1 {
color: #003152;
font-size: 0.9em;
}

The code for the cells in question is this: 有关单元格的代码是这样的:

<tr bgcolor="#FFFFFF">
<td width="150px" height="42px" class="leftCol" background="/news/newsletters/images/leftcol_box.gif" align="right"><font color="#FFFFFF"><strong>Text&nbsp;&nbsp;</strong></font></td>
<td width="298px" class="leftCol" style="padding: 5px 0px 0px 0px;"><h1>New Medical School in New Brunswick</h1></td>
</tr>

Any suggestions? 有什么建议么?

Unfortunatly, at least Outlook 2007 ignores all background related CSS-Tags and from my experience, renders margins/paddings totally different or not. 不幸的是,至少Outlook 2007会忽略所有与背景相关的CSS标记,并且根据我的经验,是否使边距/填充完全不同。

Try to create the HTML in Word if it is possible, at least Outlook07-10 and Word share the same render-engine :) 如果可能,尝试在Word中创建HTML,至少Outlook07-10和Word共享相同的呈现引擎:)

In case you have same image for all rows, put it in css class like below 如果所有行都有相同的图像,请将其放在css类中,如下所示

background-image: url("http://yoursite/news/newsletters/images/leftcol_box.gif");

background-repeat: no-repeat;

如何在一个单元格内创建均匀的单元格间距<div id="text_translate"><p>我一直在做一个小的。 但是,我有一个表格,其中所有单元格都根据每个单元格中文本的大小自动调整大小。 我将如何 go 使所有单元格的宽度相同? 例如,有 10 个单元格,每个单元格总是占用表格宽度的 10%。</p><p> 您可以看到表格的 JSFiddle,其中单元格的宽度取决于此处的文本: <a href="https://jsfiddle.net/0sLb8cyo/2/" rel="nofollow noreferrer">https://jsfiddle.net/0sLb8cyo/2/</a></p><pre> &lt;table&gt; &lt;tr&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</pre><p> 提前致谢。</p></div><table></table> - How to create even cell spacing within a <table>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 表格单元格的间距 - Table cell's spacing div表格中的单元格间距 - Cell spacing in div table 表格标题中的单元格间距 - Cell spacing in table header 无法删除表格单元格中的间距 - Cannot remove spacing in table cell HTML表格中的动态单元格间距 - Dynamic cell spacing in HTML table 如何在5行文本的表格单元格内添加一些“空格前”间距到单行文本 - How can I add some “space before” spacing to a single line of text inside a table cell of 5 lines of text 具有单元格间距但没有外部间距的全宽表 - Full-width table with cell spacing, but no outer spacing 在Outlook 2010中删除表格单元格间距 - Remove table cell spacing in Outlook 2010 间距 <li> 带有显示表格的标签 - Spacing in <li> tags with display table-cell 如何在一个单元格内创建均匀的单元格间距<div id="text_translate"><p>我一直在做一个小的。 但是,我有一个表格,其中所有单元格都根据每个单元格中文本的大小自动调整大小。 我将如何 go 使所有单元格的宽度相同? 例如,有 10 个单元格,每个单元格总是占用表格宽度的 10%。</p><p> 您可以看到表格的 JSFiddle,其中单元格的宽度取决于此处的文本: <a href="https://jsfiddle.net/0sLb8cyo/2/" rel="nofollow noreferrer">https://jsfiddle.net/0sLb8cyo/2/</a></p><pre> &lt;table&gt; &lt;tr&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;boat&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;td&gt;car&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</pre><p> 提前致谢。</p></div><table></table> - How to create even cell spacing within a <table>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM