<!DOCTYPE html><html> <head> <meta charset=”UTF-8″> <title>JS Table</title> <style> .blue { background:blue; color:#fff; } .red { background:red; color:#fff; } </style> </head> <body> <table id=”t”> <tr> <th>Column One</th> <th>Column Two</th> <th>Column Three</th> <th>Column Four</th> </tr> <tr> <td>Data One</td> <td>Data Two</td> <td>Data Three</td> <td>Data Four</td> </tr> <tr> <td>Data Five</td> <td>Data Six</td> <td>Data Seven</td> <td>Data Eight</td> </tr> </table> <script> var t = document.getElementById(“t”); //下面是 js 控制表格行列 t.rows[1].cells[1].className= “blue”; t.rows[2].cells[3].className = “red”; </script> </body></html>
css说法正确,距离右边css,css font size 打印,CSS模板网站免费初中,css做雪花飘落效果,css 背景颜色减淡的,css效果大赛