gpt4 book ai didi

html - 如何将内容保留在表格的单元格内并留有一定的边距

转载 作者:行者123 更新时间:2023-11-28 10:59:45 25 4
gpt4 key购买 nike

我有以下 HTML 代码:

<table width="600px" height="275px" cellspacing="10" cellpadding="0" border="0" align="center" style="background: #ffff00; padding-left:0px; padding-right:0px; text-align: center;">
<tbody>
<tr>
<td colspan="3">Silo'd Doc &amp; Header - &quot;Your doctors wants to connect with you.&quot;</td>
</tr>
<tr style="text-align: center;">
<td style="height: 275px; width: 175px; background: url('http://wmed.com/images/email/POLCampaign/BlueBox.png') no-repeat;">STUFF GOES HERE</td>
<td style="height: 275px; width: 175px; background: url('http://wmed.com/images/email/POLCampaign/BlueBox.png') no-repeat;">OTHER STUFF GOEScd HERE</td>
<td style="height: 275px; width: 175px; background: url('http://wmed.com/images/email/POLCampaign/BlueBox.png') no-repeat;">AND FINALLY</td>
</tr>
</tbody>
</table>

在 IE 中显示以下内容:

以及 FF 中的以下内容:

我会使用 SPAN/DIV 但我的代码库中只允许使用 table

我怎样才能让蓝色框在黄色主表内水平居中,并且每个蓝色框的内容都保留在蓝色框内,所有浏览器的边缘都有 5 像素的填充?

最佳答案

添加overflow:autoword-wrap:break-word给你的<td>元素。

CMIIW~

关于html - 如何将内容保留在表格的单元格内并留有一定的边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22509318/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com