有谁知道如何在VML文本框中对齐表格?左和中心工作正常但右边似乎被忽略了......
Heres和代码示例
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td bgcolor="#DDDDDD" style="background-image: url('http://i.imgur.com/XCnBXwP.png');" background="http://i.imgur.com/XCnBXwP.png" height="92" valign="top"><!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px;height:92px;">
<v:fill type="tile" src="http://i.imgur.com/XCnBXwP.png" color="#7bceeb" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
<table width="300" border="0" cellpadding="0" cellspacing="0" align="right">
<tr>
<td bgcolor="#FF00FF" align="right" style="font-family:Arial, Helvetica, sans-serif; font-size:20px; font-weight:bold;"> | This is test text | </td>
</tr>
</table>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]--></td>
</tr>
</table>
答案 0 :(得分:0)
尝试将<div>
设为width:100%;
。如果这不能解决问题,请在其中放置一个100%宽度的表,嵌套并对齐孩子(您想要的内容)。
示例:
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td bgcolor="#DDDDDD" style="background-image: url('http://i.imgur.com/XCnBXwP.png');" background="http://i.imgur.com/XCnBXwP.png" height="92" valign="top"><!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px;height:92px;">
<v:fill type="tile" src="http://i.imgur.com/XCnBXwP.png" color="#7bceeb" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div style="width:100%;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right">
<table width="300" border="0" cellpadding="0" cellspacing="0" align="right">
<tr>
<td bgcolor="#FF00FF" align="right" style="font-family:Arial, Helvetica, sans-serif; font-size:20px; font-weight:bold;"> | This is test text | </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]--></td>
</tr>
</table>
答案 1 :(得分:0)
对不起,迟到了派对......
你需要一个额外的div与align =“right”才能表格和内容。由于某种原因,VML文本框忽略对齐表。
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td bgcolor="#DDDDDD" style="background-image: url('http://i.imgur.com/XCnBXwP.png');" background="http://i.imgur.com/XCnBXwP.png" height="92" valign="top"><!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px;height:92px;">
<v:fill type="tile" src="http://i.imgur.com/XCnBXwP.png" color="#7bceeb" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
<div align="right">
<table width="300" border="0" cellpadding="0" cellspacing="0" align="right">
<tr>
<td bgcolor="#FF00FF" align="right" style="font-family:Arial, Helvetica, sans-serif; font-size:20px; font-weight:bold;"> | This is test text | </td>
</tr>
</table>
</div>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>
这是link