Html code:
@默 Sampleapplication.Models.samplemodel
<body>
<table id="tabledetails" class="table table-bordered loaded-table">
<thead>
<tr>
<th> <p>Id</p></th>
<th> <p>Name</p></th>
<th> <p>Department</p></th>
</tr>
</thead>
<tbody></tbody>
</table>
</body>
success: function (data) {
$.each(data, function (i, item) {
var rows = "<tr>"
+ "<td class='prtoducttd1'>" + item.Id + "</td>"
+ "<td class='prtoducttd2'>" + item.Name + "</td>"
+ "<td class='prtoducttd11'>@Html.ListBoxFor(m => m.sDepartmentList, Model.lstToDepartment, new { Name = "Departmentlst", id = "Departmentlst", @placeholder = "Select Deaprtment" })</td>"
+ "</tr>";
$('#tabledetails tbody').append(rows);
});