I have my template file which has data being populated into it. However I want to be able to write a class to every odd list element.
The issue i have is that some of the fields being listed are hidden when there is no data and as such i cannot simply write in the class of every other element.
I know I could do this using javascript, but would prefer not to.
Is there any way I can use the page_prerender to look at which list items are going to be displayed and add a class to each odd element?
for example my template looks like this but with many more fields:
<ul>
<li>
<h3>Data title</h3>
<p><%=GetDymanicData1 %></p>
</li>
<!-- if statement to check if data has value, else do not show -->
<li>
<h3>Data title</h3>
<p><%=GetDymanicData2 %></p>
</li>
<li>
<h3>Data title</h3>
<p><%=GetDymanicData2 %></p>
</li>
...
</ul>
Description
This is not
c#this is a question abouthtmlandcss.You can do this in pure
css. Check out my sample and this jsFiddle DemonstrationSample
CSS