Here I have created sample that will help you out.
Index(View)
<div>
<table>
<tr>
<th>
ID
</th>
<th>
Name
</th>
<th>
Email
</th>
<th>
contact
</th>
<th>
Country
</th>
<th>
Department
</th>
</tr>
<% foreach (var item in Model)
{ %>
<tr>
<td>
<%: item.ID %>
</td>
<td>
<%: item.Name %>
</td>
<td>
<%: item.Email %>
</td>
<td>
<%: item.contact %>
</td>
<td>
<%: item.Country %>
</td>
<td>
<%: item.Department %>
</td>
</tr>
<% } %>
</table>
</div>
HomeController(Controller)
public ActionResult Index()
{
IEnumerable<Employee> emp = new List<Employee>()
{
new Employee(){Name="David",Email="david@hr.com",contact="56142582376",Country="New Zealand" ,Department="HR"},
new Employee(){Name="Jhon",Email="Jhon@it.com",contact="8934758934",Country="Sweden",Department="IT"},
new Employee(){Name="Natsha",Email="Natsha@hr.com",contact="2386784356",Country="United Kingdom",Department="HR"},
new Employee(){Name="Maria",Email="Maria@it.co.uk",contact="1248902357",Country="United Kingdom",Department="IT"},
new Employee(){Name="james",Email="james@acc.com",contact="325783589",Country="America",Department="ACC"},
new Employee(){Name="Paul",Email="Paul@it.com",contact="95804693476",Country="South Africa",Department="IT"},
new Employee(){Name="Desiel",Email="Desiel@hr.com",contact="0085947587258",Country="Russia",Department="HR"},
new Employee(){Name="Ronald",Email="Ronald@acc.com",contact="89756237523",Country="Germany",Department="ACC"},
new Employee(){Name="Thomas",Email="Thomas@acc.com",contact="889456785665",Country="France",Department="ACC"},
new Employee(){Name="Ryan",Email="Ryan@it.com",contact="2467846786376",Country="America",Department="IT"},
new Employee(){Name="Dave",Email="Dave@hr.com",contact="3578934758965",Country="Germany",Department="HR"},
new Employee(){Name="Sara",Email="Sara@ac.com",contact="4578975823",Country="Poland",Department="ACC"},
new Employee(){Name="Dayna",Email="Dayna@it.com",contact="76578237865",Country="Australia",Department="IT"}
};
IEnumerable<Employee> employees = emp.Select((x, i) => new Employee
{
ID = i + 1,
contact = x.contact,
Country = x.Country,
Department = x.Department,
Email = x.Department,
Name = x.Name
});
return View(employees);
}
Employee(Model)
public class Employee
{
public int ID { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string contact { get; set; }
public string Country { get; set; }
public string Department { get; set; }
}
Screenshot
