javascript table美化滑鼠滑動儲存格變色

來源:互聯網
上載者:User

ttp://www.w3.org/TR/html4/strict.dtd" target="_blank">http://www.w3.org/TR/html4/strict.dtd"> </p><p> <meta http-equiv="content-type" content="text/html; charset=utf-8"><br /><style type="text/css"> .cssguycomments {background:#eee;border:#ddd;padding:8px;margin-bottom:40px;} .cssguycomments p {font:normal 12px/18px verdana;} </p><p>table {border-collapse:collapse;} thead th { font:bold 13px/18px georgia; text-align:left; background:#fff4c6; color:#333; padding:8px 16px 8px 8px; border-right:1px solid #fff; border-bottom:1px solid #fff; } thead th.null {background:#fff;} tbody th { font:bold 12px/15px georgia; text-align:left; background:#fff9e1; color:#333; padding:8px; border-bottom:1px solid #f3f0e4; border-right:1px solid #fff; } tbody td { font:normal 12px/15px georgia; color:#333; padding:8px; border-right:1px solid #f3f0e4; border-bottom:1px solid #f3f0e4; } /* 這3個是關鍵 --cssrain.cn */ tbody td.on {background:green;} thead th.on {background:red;} tbody th.on {background:red;} </style><p><p>Final example with JavaScript applied. Hover over a table cell to see effects. "View Source" and copy if you'd like to use.</p><table id="rockartists"><thead><tr><th class="null"> </th><th class="stones">Rolling Stones</th><th class="u2">U2</th><th class="crue">Mötley Crüe</th></tr></thead><tbody><tr><th>Lead Vocals</th><td class="stones">Mick Jagger</td><td class="u2">Bono</td><td class="crue">Vince Neil</td></tr><tr><th>Lead Guitar</th><td class="stones">Keith Richards</td><td class="u2">The Edge</td><td class="crue">Mick Mars</td></tr><tr><th>Bass Guitar</th><td class="stones">Ron Wood</td><td class="u2">Adam Clayton</td><td class="crue">Nikkie Sixx</td></tr><tr><th>Drums</th><td class="stones">Charlie Watts</td><td class="u2">Larry Mullen, Jr.</td><td class="crue">Tommy Lee</td></tr></tbody></table><p>
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.