Fagerlund
(Jesper Fagerlund)
March 5, 2018, 9:31am
1
Hey.
I have a series of product, that all have data fields connected, that I need to display in tabular look.
So on a product page, I connect a data collection, where each line is a set of data.
I want to add a colored background to every other line. But how do I go about doing this?
vincent
(Vincent Bidaux)
March 5, 2018, 1:09pm
2
Every other is achieved with CSS using pseudo elements nth-child .
For example if your lines are divs:
div.yourclass:nth-child(even) {background: #CCC}
div.yourclass:nth-child(odd) {background: #FFF}
Are you comfortable enough with custom code to try that by yourself, or can you make use of some guidance?
Fagerlund
(Jesper Fagerlund)
March 5, 2018, 1:19pm
3
Hi Vincent.
Thanks. I do understand the nth-child class. But I am not sure how to get it into Webflow in my collection class, that pulls data from a “data”-collection onto a product collection. I just float text boxes at the moment, in a flex box container… I am not sure where to add the code.
samliew
(webflowexpert.com)
March 5, 2018, 10:21pm
4
Please provide your published page URL.
Fagerlund
(Jesper Fagerlund)
March 6, 2018, 10:15am
5
http://milford.webflow.io/produkter/aluexcel
with password: tree
Still a wireframe, but that table is CMS data: one entry pr row.
samliew
(webflowexpert.com)
March 6, 2018, 10:36pm
6
Try this
.data-collection-list > div { background: #eee; }
.data-collection-list > div:nth-child(odd) { background: #fff; }