我有大约35个单选按钮列表值将显示在我的视图中使用@ html.RadioButtonFor在.cshtml页面中的html助手。如何在mvc4中水平和垂直对齐单选按钮列表值?
我想显示在9列和4行。
在使用类似“RepeatLayout”,“RepeatDirection”,“RepeatColumns”的控件属性的Asp.net中,我们可以实现这一点。
我想将它应用于mvc4.Is是否有任何方法来实现相同的东西?
请帮忙!
控制器代码:
ViewBag.Ratio = query.Select(m => new SelectListItem { Value = m.RatioID, Text = m.Ratio_Description });
.cshtml代码
<td colspan="3" >
@foreach (var item in (IEnumerable<SelectListItem>)ViewBag.Ratio)
{
@Html.RadioButtonFor(m => m.RatioType, new { @item.Value, @item.Text })
<label for = "@item.Value">@item.Text</label>
}
</td>
您可以通过使用[第n个孩子()](http://www.w3schools.com/cssref/sel_nth-child.asp) – glautrou 2014-09-11 13:32:31
请粘贴代码 – Jay 2014-09-11 13:35:46
周杰伦嗨,这是适应你的CSS我的代码 – Himani 2014-09-12 08:54:01