News:

Wondering if this will always be free?  See why free is better.

Main Menu

Alternating rows background

Started by holyguyver, May 10, 2016, 07:26:53 PM

Previous topic - Next topic

holyguyver

Any way to do this with the Curve theme? http://www.simplemachines.org/community/index.php?topic=15879.0

Irisado

Welcome to SMF :).

Just a small point. Please avoid reviving three year old topics.  It is much better to start a new topic than to raise one which is so old. Topic split.
Soñando con una playa donde brilla el sol, un arco iris ilumina el cielo, y el mar espejea iridescentemente

holyguyver

Thanks. So does anyone know how to do this with a Curve theme?

qc

I think it is not possible with CSS modifications only, so you would need to modify the BoardIndex.template.php & co.
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

CrimeS

Can you please specify, which row's background you would like to alternate?

qc

@holyguyver @CrimeS is right, you have to state which tables you want to modify. For the board index, you would require changing the HTML structure while for the message index (listing of topics in a board), you could e.g. add
#messageindex tr:nth-child(odd) td {
background: #EEF;
}

#messageindex tr:nth-child(even) td {
background: #FFF;
}
to the end of curve's index.css.
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

holyguyver

QC, thank you, I actually needed to know both, so thank you for the help on the message index :D . So what do I need to do to the html structure to do it to the board index? All help is greatly appreciated :D .

Antechinus

Shouldn't need to change the markup. Something like this should do it:

#boardindex_table .content tr:nth-child(odd) td {
background: #EEF;
}

#boardindex_table .content tr:nth-child(even) td {
background: #FFF;
}

qc

@Antechinus That was also my first idea, but unfortunately some boards have rowspan 2 while others have a rowspan of 1. So I would either fix that (make all board rows of rowspan 1) and then use your CSS or simply make PHP give the odd boards another CSS class.
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Antechinus

Ah. I forgot about the effing rowspan. Fixing the markup would be the best way to do it IMO. You could just drop the child boards in another div in td.info.

holyguyver

Antechinus, thank you, that worked :D I greatly appreciate the help which you & everyone else has provided, thank you.

Here is the theme I have been working on, it isn't perfect yet, but it is getting there thanks to the help from all of you:
hxxp:jackkemplin.com/thecrowchamberoom/ [nonactive]

Advertisement: