Preview
Name Surname Marital status Age Birthday Is working
Joe Crosswave Married 32 1/5/1993 False
Merry Lisel Widowed 41 5/6/1983
Henry Crux Single 29 11/19/1995 True
Cody Jurut 49 8/11/1975 False
View

@model DataTable

@(Html
    .Grid(Model.Rows.Cast<DataRow>())
    .Build(columns =>
    {
        foreach (DataColumn? column in Model.Columns)
        {
            String name = column!.ColumnName;

            columns.Add(model => model[name] as String).Filterable(true).Sortable(true).Named(name).Titled(column.Caption);
        }
    })
    .Empty("No data found")
    .Pageable(pager =>
    {
        pager.RowsPerPage = 4;
    })
)