Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 宽度不适用于表格单元格_Html_Css - Fatal编程技术网

Html 宽度不适用于表格单元格

Html 宽度不适用于表格单元格,html,css,Html,Css,出于某种原因,当我在表格中设置单元格的宽度时,它不会影响单元格的宽度。仅供参考,我正在为邮件程序使用内联样式 <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="center"> <table cellpadding="0" cellspacing="0" width="550" style="width: 100%; m

出于某种原因,当我在表格中设置单元格的宽度时,它不会影响单元格的宽度。仅供参考,我正在为邮件程序使用内联样式

<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td align="center">
            <table cellpadding="0" cellspacing="0" width="550" style="width: 100%; max-width: 550px; text-align: center; border: 1px solid #003a4b;">
                <tr>
                    <td style="padding-top: 10px;"><span style="font-family: helvetica, sans-serif; font-size: 37px; font-weight: bold; color: #93d600; border-bottom: 1px solid #003a4b;">Hunters Conference 2017</span></td>
                </tr>

                <tr>
                    <td width="80%" style="padding: 20px 0; background-color: blue;"><span style="font-family: helvetica, sans-serif; font-size: 16px; color: #003a4b; background-color: red;">Fyber were honoured to attend and support such a fantastic conference, congratulations to everyone that won a prize on our wheel of fortune!</span></td>
                </tr>

                <tr>
                    <td width="80%" style="padding: 0 55px; padding-bottom: 20px;"><span style="font-family: helvetica, sans-serif; font-size: 16px; color: #003a4b;">We hope you all had a great day, we enjoyed catching up with everyone and it was nice to see our clients face to face. </span></td>
                </tr>

                <!--[if mso]>
                <tr>
                    <td style="padding-bottom: 20px;">
                        <img src="https://gallery.mailchimp.com/b083c967cd22e35ab4ce75e7a/images/2c3e3b5e-9a9f-4864-a36f-6359b0dd4b75.jpg" alt="Spinning Wheel" width="550" style="width: 100%; max-width: 550px;">
                    </td>
                </tr>
                <![endif]-->

                <!--[if !mso]><!-- -->
                <tr>
                    <td style="padding-bottom: 20px;">
                        <img src="https://gallery.mailchimp.com/b083c967cd22e35ab4ce75e7a/images/19e810cd-df47-474b-aa47-3f33bf26922a.gif" alt="Spinning Wheel" width="550" style="width: 100%; max-width: 550px;">
                    </td>
                </tr>
                <!--<![endif]-->
            </table> 
        </td>
    </tr>
</table>

2017年猎人大会
Fyber很荣幸能参加并支持这样一个精彩的会议,祝贺所有在我们的幸运之轮上获奖的人!
我们希望你们都度过了美好的一天,我们很高兴能与大家见面,很高兴见到我们的客户。

最后一次
td
width
550px
因此不会影响您的
宽度
80%


因此,您可以在
span
标记上添加
宽度
,则无论您做什么,它都将始终保持表格的全宽。 一种方法是在td内创建一个表,并将宽度放在表上。此外,在电子邮件中,左右填充也不起作用,因此创建具有定义宽度的表格并将其居中是最好的选择

另一种方法是在左侧和右侧设置间隔单元,以提供填充空间。我按照第一种方法修改了您的代码(只有蓝色/红色和白色背景的文本单元格)

请注意:我并没有修复你所有的代码,只是修改了一些来让你开始


2017年猎人大会
Fyber很荣幸能参加并支持这样一个精彩的会议,祝贺所有在我们的幸运之轮上获奖的人!
我们希望你们都度过了美好的一天,我们很高兴能与大家见面,很高兴见到我们的客户。