v2.5.2
Giriş yap

table de stun renklendirme

dengesiz1122
230 defa görüntülendi

Merhabalar bir tablem var bu tablede satırları renklendirmek için kullandığım
css kodu

            body {
            background: #333;
            color: #fff;
        }

        th {
            padding: 10px;
            background: black;
            vertical-align: bottom;
            text-align: center;
            color: yellow;
        }

        .verticaltext {
            font-size: 2em;
            -ms-writing-mode: tb-rl;
            -webkit-writing-mode: vertical-rl;
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            white-space: nowrap;
        }

        td {
            font-size: 1.2em;
            padding: 3px;
        }

        .active {
            background: red;
            cursor: pointer;
        }

ayrıca kullanmış olduğum java koduda

<script>
        $(document).ready(function() {
            $("tr.lists").click(function() {
                $(this).toggleClass("active");
            });
        });
    </script>

sorum ise bu tablede stunları nasıl renklendirebilirim . Teşekür ediyorum.

Cevap yaz
Cevaplar (1)
abidino
553 gün önce

table tr td:nth-child(2){} // sadece 2. sütun
table tr td:first-child{} // ilk sütun
table tr td:last-child{} // son sütun
table tr td:nth-child(even){} // tek sayıya göre sütunlar (1,3,5,7)
table tr td:nth-child(odd){} // çift sayıya göre sütunlar (2,4,6,8)