中心在展望中对齐

时间:2014-05-10 09:24:11

标签: css html-table outlook html-email

我正在尝试创建无法在Outlook中运行的响应式电子邮件程序。你能帮帮我吗?我也尝试插入div对齐中心,但仍然无法正常工作。 现在它的中心对齐,但当我在移动设备上查看它时,它左对齐。

<center>
<!--[if mso]>
    <table style="width: 300px;">
        <tr>
            <td>
            <![endif]-->
            <!--one-->
            <table border="0" cellpadding="0" cellspacing="0" align="left" width="225" height="158" bgcolor="#006699">
                <tr>
                    <td style="padding: 0;" align="left" class="responsive-image middle">
                        <img src="http://www.eruditus.com/emailer/0418_responsive_columbia/bg.jpg" style="display: block; margin: 0; padding: 0;">
                    </td>
                </tr>
            </table>
            <table border="0" cellpadding="0" cellspacing="0" align="left" width="225" bgcolor="#0093d4" height="158px">
                <tr>
                    <td width="" style="padding: 0 0 0 0; background-color: #0093d4; vertical-align: top;" bgcolor="#0093d4" valign="top">
                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#0093d4">
                            <tr>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 20px; padding: 5px 0 0;" bgcolor="#0093d4" valign="top">&nbsp;</td>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 20px; padding: 0;" bgcolor="#0093d4" valign="top">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="56" style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 20px; padding: 5px 0 0 10px;" bgcolor="#0093d4" valign="top">Email:</td>
                                <td width="273" style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 20px; padding: 0;" bgcolor="#0093d4" valign="top"><a href="mailto:epm_columbia@eruditus.com" style="color: #fff; text-decoration: none; font-size: 12px; display: block; padding: 5px 0 0;">EPM_columbia@eruditus.com</a>
                                </td>
                            </tr>
                            <tr>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 20px; padding: 0 0 0 10px;" bgcolor="#0093d4" valign="top">Phone:</td>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 0px; padding: 0;" bgcolor="#0093d4" valign="top"><span style="font-size: 12px; line-height: 20px;">+91 22 6162 3112(India)</span>
                                </td>
                            </tr>
                            <tr>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 0; padding: 0;" bgcolor="#0093d4" valign="top">&nbsp;</td>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 0; padding: 0;" bgcolor="#0093d4" valign="top"><span style="font-size: 12px; line-height: 20px;">+971 044302011(Dubai)</span>
                                </td>
                            </tr>
                            <tr>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 0; padding: 0;" bgcolor="#0093d4" valign="top">&nbsp;</td>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 0; padding: 0;" bgcolor="#0093d4" valign="top"><span style="font-size: 12px; line-height: 20px;">+1 862 252 5823(USA)</span>
                                </td>
                            </tr>
                            <tr>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 0; padding: 0;" bgcolor="#0093d4" valign="top">&nbsp;</td>
                                <td style="color: #fff; background-color: #0093d4; vertical-align: top; font-size: 12px; line-height: 0; padding: 0;" bgcolor="#0093d4" valign="top">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
 </center>

1 个答案:

答案 0 :(得分:1)



将表放在div内,并在div标记中添加align="centre"

这可能会解决问题。