Need Conditional Formatting Help

Topics: User Forum
Feb 2, 2015 at 7:30 PM
I am new to PHPExcel and have made great progress except for one thing. I am still trying to understand how to turn an Excel Conditional Format into a PHPExcel Conditional format. My desire is to set up alternate rows of background color for a table on a worksheet. In Excel I use the formula "=MOD(ROW(),2)=0" along with a background color format to color every other row. This will also work when the rows are sorted.

How can I set this up as a conditional then apply it to the rows on my worksheet?

Thanks in advance,

Feb 2, 2015 at 8:12 PM
My recommendation would be not to use conditional styles for this, but simply to use normal styles
Feb 2, 2015 at 9:59 PM
If I use a normal style and just set the background color of each row, when the table is sorted the alternate coloring gets messed up. Am I missing something?
Feb 2, 2015 at 10:27 PM
Yes, you can use conditional formatting, and it will retain that on a sort, but it uses a lot of memory which will limit the number of rows that you can save without breaking PHPExcel
Feb 3, 2015 at 12:32 AM
Thanks for the reply. So it sounds not practical. Still, can you show me the correct syntax for setting it up? Would I have to iterate through the rows applying it individually?