Thursday, 19 September 2013

How to style the td in only one grid when my page have two grids?

How to style the td in only one grid when my page have two grids?

My page have two grids called grid1,grid2,I only want to style the
grid1,not grid2.I use the css style in the header like this,but it seems
that both grid changed.
.k-grid td {
color:red;
padding: 0px;
}
I try to write like this,but failed.
.GridTd {
color:red;
padding: 0px;
}
$("#grid1 td").addClass("GridTd "); //failed
$("#grid1 k-grid td").addClass("GridTd ");// faied
I debug with firebug and find that the td style is used by default
style(.k-grid td),not GridTd Style.
.k-grid td {
border-style: solid; border-width: 0 0 0 1px;
line-height: 1.6em; overflow: hidden;
padding: 0.4em 0.6em; text-overflow: ellipsis;
vertical-align: middle;
}.
.GridTd { color:red; padding: 0;}

No comments:

Post a Comment