목록에 배경색 넣기
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<List<EmptyMvcApplication.Models.Entity.MountainInfo>>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<meta name="viewport" content="width=device-width" />
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#summits tr:nth-child(even)").css("background-color", "silver");
//서로 다른 결과를 볼 수 있다.
//$("#summits tr:even").css("background-color", "silver");
});
</script>
<style type="text/css">
table, table td { padding: 30px; border-spacing: 0;}
</style>
<title>Zebra</title>
</head>
<body>
<div id="summits">
<table>
<thead>
<tr>
<td>Item</td>
<td>Height</td>
<td>Actions</td>
</tr>
</thead>
<% foreach (var item in Model)
{
%>
<tr>
<td><%: item.Name %></td>
<td><%: item.HeightinMeters %></td>
<td>
<% using (Html.BeginForm("ZebraDelete", "AjaxSample", new { itemID = item.No }, FormMethod.Post))
{ %>
<input type="submit" value="Delete" />
<% } %>
</td>
</tr>
<%
}
%>
</table>
</div>
</body>
</html>