티스토리 뷰

💼 정보 ver1.0

목록에 배경색 넣기

James Wetzel 2013. 6. 8. 13:02

<%@ 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>



반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함