【发布时间】:2017-07-28 11:53:59
【问题描述】:
我有一个 4 列表,最后一列包含一个“+”按钮。它的功能是单击时添加附加列。但是它显示在所有行中,我希望它只显示在表格的最后一行。
这是代码
<table class="table table-responsive table-bordered" style="width:100%" id="HeightConfig">
<tbody id="HeightConfigBody">
@if (Model != null)
{
@foreach (var data in Model.Reverse())
{
<tr>
<td style="width:40%">
<label><b>Recorded Time:</b> <input type="text" id="recordDate" class="recordDate"
value="@data.recordDate.ToString("yyyy-MM-dd")" disabled></label>
</td>
<td style="width:40%">
<label><b>Height (CM):</b> <input type="text" id="ColumnTypeData" class="ColumnTypeData"
value="@data.ColumnTypeData" ></label>
</td>
<td style="width:40%">
<a class="btn btn-primary btn-default" title="delete"
data-target="#modal-container" data-toggle="modal" data-align="center">
<div id="minusHeight"><i class="fa fa-minus" aria-hidden="true"></i></div>
</a>
<a class="btn btn-primary btn-default" title="add" >
<div id="addHeight" ><i class="fa fa-plus" aria-hidden="true"></i></div>
</a>
</td>
</tr>
}
}
</tbody>
</table>
刚刚在表格中显示了 for 循环,因为它正在填充数据。
这是截图
我想要的是加号按钮只显示在表格的最后一行
【问题讨论】:
标签: javascript html user-interface bootstrap-4