我有一个包含以下代码的 MVC View 。
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
.
.
.
.
</table>
@using (Html.BeginForm())
{
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
.
.
.
.
.
}
</td>
</tr>
</table>
如您所见,上面的两个表格都是 @using (Html.BeginForm())
,宽度为 960,但是当此代码在浏览器中呈现时,它会自动将宽度设为 1100px 给 表单标签
(代码中的Html.BeginForm()
)。我不知道它来自哪里?我正在考虑在 Html.BeginForm()
中设置宽度,或者是否有更好的主意,但我什至不知道如何将宽度设置为 Html.BeginForm()
。请帮忙。
谢谢。
最佳答案
好主意是在 css 文件中给出宽度
table form{
width:960px;
}
关于html - 在 MVC 3 中将宽度设置为 Html.BeginForm(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22067543/