我试图实现一个'CheckboxListFor‘方法,但是在格式化方面有一些问题,其中复选框的文本不在复选框的旁边对齐,而是在复选框下面。

查看代码:
@{
var htmlListInfo = new HtmlListInfo(HtmlTag.table, 4, null,
TextLayout.Default, TemplateIsUsed.No);
}
@Html.CheckBoxListFor(model => model.KeywordIDs,
model => model.Keywords,
model => model.KeywordId,
model => model.Name,
model => model.SelectedKeywords,
htmlListInfo
);任何洞察力都将不胜感激。
发布于 2013-09-02 06:22:30
好的gr8..。小小的改变。试试这段代码。
必须应用css来修复它。
<style type="text/css">
label
{
display: inline-block !important;
padding: 5px !important;
}
</style>
@{
var htmlListInfo = new HtmlListInfo(HtmlTag.table, 4, null, TextLayout.Default, TemplateIsUsed.No);
@Html.CheckBoxListFor(model => model.PostedCities.CityIDs,
model => model.AvailableCities,
city => city.Id,
city => city.Name,
model => model.SelectedCities,
htmlListInfo)
}让我知道你的意见。
https://stackoverflow.com/questions/18566109
复制相似问题