Re: [問題] 表格隔行背景色

看板Web_Design作者 (火鍋)時間17年前 (2008/04/29 14:24), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/4 (看更多)
針對某一個table作不同顏色的分色 設定某一個table的id叫做tableID <script type="text/javascript"> window.onload = function(){ var table_rows = document.getElementById("tableID").rows.length; var table = document.getElementById("tableID") for (i=1;i<=table_rows;i++) { if ((i%2)==1) { table.rows(i).bgColor="#色碼"; } } } </script> -- 海綿寶寶, 不要講話!派大星! 我覺得有人在盯著我們看... 你會害我們被發現! JUNU -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.250.32.15 ※ 編輯: arianda 來自: 60.250.32.15 (04/29 14:25)

06/21 00:20, , 1F
06/21 00:20, 1F
文章代碼(AID): #185hyf0b (Web_Design)
文章代碼(AID): #185hyf0b (Web_Design)