0

我有一个在表格中显示复选框的编辑器模板。使用下面的代码,所有复选框都将呈现在一行上。有人可以建议如何每行呈现三个复选框吗?

编辑器模板

@model AssignedBusAreaData
@using MOC.ViewModels

<td>
    @Html.HiddenFor(model => model.BusinessAreaID)    
    @Html.CheckBoxFor(model => model.Assigned)
    @Html.DisplayFor(model => model.BusinessAreaName)
</td>

看法

    <div class="editor-label">
        @Html.LabelFor(model => model.BusinessAreas)
    </div>
    <div class="editor-field">
        <table>
            <tr>
                @Html.EditorFor(model => model.BusinessAreas)
            </tr>
        </table>
    </div>
4

1 回答 1

1

尝试这个

<table>
  <tr>
   <td>
    @Html.HiddenFor(model => model.BusinessAreaID)    
    @Html.CheckBoxFor(model => model.Assigned)
    @Html.DisplayFor(model => model.BusinessAreaName)
   </td>
 </tr>
</table>

看法

<div class="editor-label">
    @Html.LabelFor(model => model.BusinessAreas)
</div>
<div class="editor-field">
    <table>
        <tr>
          <td>
            @Html.EditorFor(model => model.BusinessAreas)
          </td>
        </tr>
    </table>
</div>
于 2013-04-04T08:55:23.557 回答