I want to convert a html table of a view to excel format file. somthing like that:
@model DataTable
<table class="table table-hover table-responsive table-striped">
<thead>
<tr >
@foreach (DataColumn col in Model.Columns)
{
<th class="border-white">@col.Caption</th>
}
</tr>
</thead>
<tbody>
@foreach (DataRow row in Model.Rows)
{
<tr>
@foreach (DataColumn col in Model.Columns)
{
<td class="border-white">@row[col.ColumnName]</td>
}
</tr>
}
</tbody>
I searched in web, but I don't find anything. Information about this issue limit to export a SQL table or a model class to excel file. Can anyone help me, how I export html table to excel?