2014-04-10 55 views
1

有誰知道如何在VML文本框中對齊表嗎?左邊和中間的工作不錯,但權似乎被忽略....表格在VML文本框中對齊RIGHT?

繼承人和示例代碼

<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

的嘗試設置你的<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> 
+0

沒有抱歉,這沒有工作!我需要能夠對齊表格,以便可以將兩個表格彼此相鄰,一個左側(正常工作),但右側對齊會完全忽略! – harte11

+0

爲什麼不把兩個'​​放在同一行呢?只有當屏幕寬度縮小(不適合)時,如果您希望內容溢出(向下彈出),對齊纔是很好的選擇。使用2'​​'將確保它們始終保持彼此相鄰。另外,如果你想對齊,你應該在同一個方向上對齊它們。大多數客戶端都是由父''驅動的,所以在浮動/對齊表本身中添加衝突的方向會產生不一致的結果。 – John

0

對不起,晚來參加聚會...

你,你表&內容之前需要ALIGN = 「正確」 的額外股利。出於某種原因,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