0
我有一個表Chrome和IE顯示diffrence
<tr>Page header goes here</>
<tr valign="top">
<td align="center" height="100%" valign="top">
<center>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="1">
<tbody>
<tr height="29%">
<td height="29%">
// to display the below tr in center of page
</td>
</tr>
<tr height="31%">
<td bgcolor="FFFFFF" height="31%" align="center" valign="top">
<table width="40%" height="31%" border="0" align="center" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="16">
<img src="@Href("~/Content/themes/base/images/top_lef.gif")" width="16" height="100%" />
</td>
<td height="16" style="background-image: url('@Url.Content("~/Content/themes/base/images/top_mid.gif")')">
<img src="@Href("~/Content/themes/base/images/top_mid.gif")" width="16" height="100%" />
</td>
<td width="24">
<img src="@Href("~/Content/themes/base/images/top_rig.gif")" width="24" height="100%" />
</td>
</tr>
<tr>
<td width="16" style="background-image: url('@Url.Content("~/Content/themes/base/images/cen_lef.gif")')">
<img src="@Href("~/Content/themes/base/images/cen_lef.gif")" width="16" height="100%" />
</td>
<td bgcolor="#F7F8FB" valign="top">
<div style="height: 30px;">
</div>
@using (Html.BeginForm())
{
//login details username and password
}
</td>
<td width="24" style="background-image:url('@Url.Content("~/Content/themes/base/images/cen_rig.gif")')">
<img src="@Href("~/Content/themes/base/images/cen_rig.gif")" width="24" height="100%" />
</td>
</tr>
<tr>
<td width="16" height="16">
<img src="@Href("~/Content/themes/base/images/bot_lef.gif")" width="16" height="16" />
</td>
<td height="16" style="background-image: url('@Url.Content("~/Content/themes/base/images/bot_mid.gif")')">
<img src="@Href("~/Content/themes/base/images/bot_mid.gif")" width="16" height="16" />
</td>
<td width="24" height="16">
<img src="@Href("~/Content/themes/base/images/bot_rig.gif")" width="24" height="16" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr height="39%">
<td height="39%">
// to display the above tr in center of page
</td>
</tr>
</tbody>
</table>
</center>
</td>
</tr>
<tr>Page footer goes here</>
我添加了一個tr和TD,帶20和31%以上,所述主體在我的登錄控制去
@using (Html.BeginForm())
{
}
下面但在IE中,登錄控件顯示在中間,但在Chrome中,登錄顯示在頁面標題之後。它似乎沒有考慮到29%的高度。我試着添加
,但兩種瀏覽器的結果都不一樣。
我正在尋找一個更好的方法來解決這個問題。如果有人能幫我解決這個問題。
使用表格時出現什麼問題。 – DotNetBeginner
閱讀此主題:http://stackoverflow.com/questions/83073/why-not-use-tables-for-layout-in-html – Ivotje50