Format lists with alternating background colours (e.g.: white /grey)

0
Is it possible to format lists with alternating background colours (e.g.: white / light grey)? even odd background colors.     Thanks
asked
3 answers
4

Hi, 


You can do this by adding a class to your list and add color to the even or odd rows in css. 

.MyList>ul>li:active:nth-child(odd),

.MyList>ul>li:focus:nth-child(odd),

.MyList>ul>li:nth-child(odd){

    background-color: #f7f7f7;

  }

Hope this helps.

answered
1

Shaan,

There is a built in property for this – listview-striped. 

 

Hope this helps.

answered
0

Hi Shaan,

Yes that is possible, what kind of list are you talking about? 

Listview or datagrid? 

In a listview you can set the background color very easily with the properties:

It works a little differently in a data grid, maybe THIS forum post can help you? 

answered