交替颜色行 - 不适用于两个侧边栏 [英] Alternating Color Rows - Not working for both sidebars

查看:75
本文介绍了交替颜色行 - 不适用于两个侧边栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个侧边栏。一个侧边栏从mysql查询中给出排序结果,另一个侧边栏给出来往于某个位置的路线。我正在尝试交替mysql结果的行颜色和方向的行颜色。它正在为使用此代码的方向工作,但不适用于mysql结果。任何人都知道我如何才能做到这一点?谢谢

  tr:nth-​​child(偶数){background:#CCC} 
tr:nth-​​child ){background:#FFF}


<!DOCTYPE html>
< html>
< head>

< style>
html,
body,
#map_canvas {
margin:0;
padding:0;
身高:100%;
}
表,
tr,
td {
height:100%;
}
.text {
width:300px;
height:600px;
背景颜色:白色;
overflow:scroll;
overflow-y:auto;
overflow-x:hidden;

}

#side_bar {
z-index:100;
位置:绝对;
top:135px;
剩下:1050px;
}
#panel {
z-index:-100;
display:block;
位置:绝对;
top:135px;
剩下:1050px;
}
#mdiv {
z-index:500;
width:25px;
height:25px;
display:none;
背景颜色:红色;
border:1px纯黑色;
位置:绝对;
left:1300px;
top:112px;
}
.mdiv {
height:25px;
width:2px;
margin-left:12px;
背景颜色:黑色;
transform:rotate(45deg);
-ms-transform:rotate(45deg);
/ * IE 9 * /
-webkit-transform:rotate(45deg);
/ * Safari和Chrome * /
z-index:1;
}
.md {
height:25px;
width:2px;
背景颜色:黑色;
transform:rotate(90deg);
-ms-transform:rotate(90deg);
/ * IE 9 * /
-webkit-transform:rotate(90deg);
/ * Safari和Chrome * /
z-index:2;
}

tr:nth-​​child(偶数){background:#CCC}
tr:nth-​​child(奇数){background:#FFF}

< / style>
< / head>
< link rel =stylesheettype =text / csshref =assets / css / storelocator.css/>

< body>

< div class =bh-sl-container>
< div id =page-header>
< h1 class =bh-sl-title>审核定位器< / h1>

< / div>

< div class =bh-sl-form-container>
< form id =bh-sl-user-locationmethod =postaction =#>
< div class =form-input>
< label for =bh-sl-address>输入地址或邮编:< / label>
< input type =buttonvalue =Submitonclick =codeAddress();>< / input>

< / div>


< / form>
< / div>




登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆