设置表格单双行颜色


    <script type="text/javascript">
$(document).ready(function () {
$("table").attr("bgColor", "#222222"); //设置表格的背景颜色
$("tr").attr("bgColor", "#3366CC"); //为单数行表格设置背景颜色
$("tr:even").css("background-color", "#CC0000"); //为双数行表格设置背颜色素
$("table").css("width", "300px"); //为表格添加样式,设置表格长度为300像素
});
</script>

设置表格单双行颜色,布布扣,bubuko.com

时间: 2024-08-26 12:09:45

设置表格单双行颜色的相关文章

js改变,设置table单双行颜色,jquery改变,设置table单双行颜色

1.js实现单双行以不同颜色显示 $(document).ready(function () { var color = "#ffeab3"; $("#GvList tr:odd td").css("background-color", color); //改变偶数行背景色 $("#GvList tr:odd").attr("bg", color); $("#GvList tr:even"

table 控制单双行颜色以及鼠标hover颜色 table光棒

1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="

html table单双行颜色间隔(转载)

直接上代码: 1 <html> 2 <head> 3 <meta http-equiv="Content-Type" content="text/html; charset=gb3212"> 4 <title>单双行显示不同颜色</title> 5 <script type="text/javascript"> 6 window.onload = function color

Js实现table单双行交替色

依稀记得,当初我刚学编程的时候还学过怎么实现表格单双行交替色,现如今早已记不清当时的实现思路,这两天突然想起,没事就自己写了一小段代码,也不知道是否是当年的思路,不过不用纠结这个问题.:) 代码很简单,利用纯Js实现表格单双行交替色. //Js实现表格单双行交替色 function SetTrColor(tableId) { var table = document.getElementById(tableId);//根据table的 id 属性值获得对象 var rows = table.ge

Gridview单双行

.table01_singlar        {            background-color: #FFFFFF;        }.table01_double        {            background-color: #e5eaf0;        } OnRowDataBound="gvData_RowDataBound" protected void gvData_RowDataBound(object sender, GridViewRowEve

jquery 设置表格奇偶数的颜色和行被选中的颜色样式jquery 设置表格奇偶数的颜色和行被选中的颜色样式

query 代码 $(funtion(){ //设置偶数行和奇数行 $("tbody>tr:odd").addClass("ou");   //为奇数行设置样式(添加样式类) $("tbody>tr:even").addClass("dan");  // 为偶数行设置样式类 $("tbody>tr:has(:checked)").addClass("ed");   //

隔行变色以及单双行变色,鼠标一入一出变色

1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script type = "text/javascript" src = "js/jquery/easyui-1.3.0/jquery-1.7.2.min.js"></script> 5 <script type = "text/javascript"> 6 $(document).ready(f

css单双行样式

#random_box li:nth-child(odd) {//双行 background: #fff5c4; } #random_box li:nth-child(even) {//单行 background: #ffeb8c; }

PB中datewindow单双行显示不同颜色

调出datewindow,找到detail中的列,右击properties,左侧Background中的color属性添加 IF(MOD(GETROW(),2)=0,RGB( 255, 250, 205), RGB(255, 255, 255)) 看图: