prabhu p

prabhu p

  • NA
  • 181
  • 115k

how to change table position in mvc view?

Mar 7 2015 10:13 AM
i has model,controller and view its working fine getting values from db sql.ok
but i want change table position in view(Razor) and one more question can we able to see razor view design without running application

here is view(razor)    
@model IEnumerable <practicemvc4part2.Models.Employee>
<h2>Indexs</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<div style= "background-image: url('../../Images/white-background.jpg'); height:500px; width:750px;">
<br />
<table border="1" style=" position:absolute; height:90px; width:300px; margin-left:3px; ">
<tr>
<th align="center">
@Html.DisplayNameFor(model => model.name)
</th>
<th align="center">
@Html.DisplayNameFor(model => model.gender)
</th>
<th align="center">
@Html.DisplayNameFor(model => model.city)
</th>
<th align="center">
@Html.DisplayNameFor(model => model.dob)
</th>
<th align="center">
Action
</th>
</tr>
@foreach (var item in Model) {
<tr>
<td align="center">
@Html.DisplayFor(modelItem => item.name)
</td>
<td align="center">
@Html.DisplayFor(modelItem => item.gender)
</td>
<td align="center">
@Html.DisplayFor(modelItem => item.city)
</td>
<td align="center">
@Html.DisplayFor(modelItem => item.dob)
</td>
<td align="center">
@Html.ActionLink("Edit", "Edit", new { id=item.id }) |
@Html.ActionLink("Details", "Details", new { id=item.id }) |
@Html.ActionLink("Delete", "Delete", new { id=item.id })
</td>
</tr>
}
</table>
</div>
 

Answers (2)