I have a 4-column table with the last column containing a "+" button. its function is to add additional column when clicked. However it is being shown in all of the rows, I want it to be displayed only on the last row of the table.
Here's the code
<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>
Just showed the for loop inside the table because it is populating data.
Here's the screenshot
What I want is for the plus button to be displayed only at the last row of the table