Created
July 15, 2019 21:55
-
-
Save davidsonsousa/b50ef39eca1836e389de5bc67a5e9ab4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model List<string> | |
@using System.Text | |
@section Styles { | |
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css"> | |
} | |
@{ | |
var tableHeader = new StringBuilder(); | |
@foreach (var item in Model) | |
{ | |
tableHeader.Append("<th>"); | |
tableHeader.Append(item); | |
tableHeader.Append("</th>"); | |
} | |
} | |
<div> | |
<table id="table-list" class="table table-striped table-bordered"> | |
<thead> | |
<tr> | |
@Html.Raw(tableHeader.ToString()) | |
</tr> | |
</thead> | |
<tfoot> | |
<tr> | |
@Html.Raw(tableHeader.ToString()) | |
</tr> | |
</tfoot> | |
</table> | |
</div> | |
@section Scripts{ | |
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script> | |
<script type="text/javascript" src="~/js/index.js"></script> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment