2013-03-22 73 views
1

下面是我的代碼:重寫垂直對齊屬性

<table border="0" cellspacing="1" cellpadding="0" width="100%"> 
<tr> 
<td width="31%" align="center" valign="middle"> 
<a href="http://google.com/"></a> 
</td> 
<td width="69%" valign="top"> 
Terms and conditions 
<sup>#</sup> 
</td> 
</tr> 
</table> 

superscript不工作(#是不是頂部它在同一條線上條款&條件。文本)。

我的猜測是vertical-alignsuperscript正在被table屬性覆蓋。

下面是從Web開發人員抓獲table屬性默認使用樣式表。我還拍下了sup。我沒有看到它的價值在Web開發人員中被削弱了。

tbody { 
display: table-row-group; 
vertical-align: middle; 
border-color: inherit; 
} 

tr { 
display: table-row; 
vertical-align: inherit; 
border-color: inherit; 
} 

td, th { 
display: table-cell; 
vertical-align: inherit; 
} 

td[Attributes Style] { 
width: 31%; 
text-align: -webkit-center; 
vertical-align: middle; 
} 

sup { 
vertical-align: super; 
font-size: smaller; 
} 

如果我把suptable屬性,它工作正常。我怎樣才能讓我的suptable工作?

回答

1

valign="top"是原因。如果你刪除它,上標將起作用。

<td width="69%"> 
    Terms and conditions<sup>#</sup> 
</td> 

或者,如果你想保持V-ALIGN,封裝:

<td width="69%" valign="top"> 
    <span>Terms and conditions<sup>#</sup></span> 
</td>