jquery 操作css
<styletype="text/css">
table{width:500px;}
caption{background:#DCA;}
.colorRedborderBlack{align:"right";}
</style>
<scripttype="text/javascript">
$(document).ready(function(){
//设置表格列的对齐方式
odd_even("#table_test");
//设置页面的input的宽度
$("input").each(function(){
$(this).css("width","300px");
});
});
//对齐方式函数
functionodd_even(id){
$(id).find("td").each(function(index,element){
if(index%2==1)
$(this).css("text-align","left");
else
$(this).css("text-align","right");
});
};
</script>
相关推荐
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18