//////////////////////
<table class="table table-bordered table-hover nowrap
display" id="tblID" style="width:100%">
<thead>
<tr>
<th class="text-center" style="width:5%;">
SNo.
</th>
@{var cnth = 0; }
@foreach (var property in Model.GetType().GetGenericArguments()[0].GetProperties())
{
if (cnth > 2)
{
<th>@property.Name</th>
}
cnth++;
}
<th class="text-center">
Action
</th>
</tr>
</thead>
<tbody>
@{var cntb = 0; }
@{ var cnt = 0;}
@foreach (var item in Model)
{
cntb = 0;
<tr>
@foreach (var property in item.GetType().GetProperties())
{
if (cntb == 0)
{
<td class="text-center" style="width:5%;">
@(cnt += 1)
</td>
}
if (cntb > 2)
{
<td>@property.GetValue(item)</td>
}
cntb++;
}
<td class="p-0
text-center" style="vertical-align:middle;">
@if (item.PatientCount
> 0)
{
<a href="#"><i class="glyphicon
glyphicon-download f-18"></i></a>
}
</td>
</tr>
}
</tbody>
</table>
No comments:
Post a Comment