블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

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 31
반응형

Category

Recent Post

Recent Comment

Archive

2009. 11. 25. 13:23 .Net Project/Jquery 1.3.2
반응형
 TablePlugIn.htm
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>짝수 행과 홀수행의 배경색 변경 플러그인</title>

    <style type="text/css">

        .odd { background-color:Silver; }

        .even { background-color:Aqua; }

    </style>   

    <script src="../../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        //[!] 배경색 변경을 플러그인 변경으로 업그레이드 하자
            $.fn.alternateRowColors = function () {

            $('tbody tr:odd', this).removeClass('even').addClass('odd');

            $('tbody tr:even', this).removeClass('odd').addClass('even');

            return this;

        };   

        $(document).ready(function () {

            $('table.tbl').each(function () {

                var $table = $(this);

                // 플로그인 호출                 

                $table.alternateRowColors();

            });               

        });

    </script>

</head>

<body>

    <table class="tbl" border="1">

        <thead>

            <tr>

                <th>&nbsp;</th>

                <th>제목</th>

                <th>저자</th>

                <th>출간일</th>

                <th>가격</th>

            </tr>

        </thead>

        <tbody>

            <tr>

                <td><img src="../../ProductImages/thumbs/BOOK-01.jpg" /></td>

                <td>쉽게 배우는 ASP.NET 2.0</td>

                <td>김용원</td>

                <td>2008</td>

                <td>20000</td>

            </tr>

            <tr>

                <td><img src="../../ProductImages/thumbs/COM-01.jpg" /></td>

                <td>.NET Bible</td>

                <td>김용원</td>

                <td>2003</td>

                <td>25000</td>

            </tr>

            <tr>

                <td><img src="../../ProductImages/thumbs/Online-01.jpg" /></td>

                <td>정보처리 산업 기사</td>

                <td>김용원</td>

                <td>2005</td>

                <td>18000</td>

            </tr>

        </tbody>

    </table>

</body>

</html> 




반응형
posted by Magic_kit