Dynamic column output

I output a query in three columns. For styling purpose I need to target the second record of every row (second record of every row need to have margin left and right), I.E. records 2, 5, 8, 11, 14 etc. I was trying it using the mod operator but I am a little confused. This is how I have it now:


#left-panel .colOdd,
#left-panel .colEven{
	width: 260px;
	min-height: 100px;
	margin: 0 0 40px;
	float: left;
}

#left-panel .colEven {
	margin: 0 10px 40px;
	display: inline;
}


<div class="#iif(currentrow MOD 2,DE('colOdd'),DE('colEven'))#">

</div>

But this way every second record is targeted instead of every second record of every row.

can someone point to me what I’m doing wrong

I was to late to edit my own post but I found a work around:

Instead of targeting the second record, I targeted the third one instead:


#left-panel .colOdd,
#left-panel .colEven{
	width: 260px;
	min-height: 100px;
	margin: 0 15px 40px 0;
	float: left;
	background: #993;
}

#left-panel .colEven {
	margin: 0 0 40px;
	background: #9F6;
}


<div class="#iif(currentrow MOD 3,DE('colOdd'),DE('colEven'))#">

</div>

I’m still wondering though if there is a way to target that second record as described in my first post, so answers to that question are still welcome.

Maybe I didn’t make my self clear. I don’t want just to target the second row. I would like to target the second record in every row in my column output See below the bold numbers:
1 2 3
4 5 6
7 8 9

These are the ones I would like to style

Why’s that? I use it all over the place, as well as its PHP counterpart.

pretty sure the iif function is frowned upon.

If you’re wanting to target the second and only the second row, i’d set a counter variable and when it’s equal to 2, do whatever.