php - odd even colored rows into a repeat region -


i try make work repeat region doesn't work.

<body> <?php { ?> <table class="test"> <tr> <td><?php echo $row_recordset1['fld1']; ?></td> <td>...</td> <td><?php echo $row_recordset1['fld2']; ?></td> <td>...</td> <td><?php echo $row_recordset1['fld3']; ?></td> </tr> </table> <?php } while ($row_recordset1 = mysql_fetch_assoc($recordset1)); ?> </body> 

and style is

<head> <style type = "text/css"> .test tr:nth-child(even) {background: #a4d1ff;} .test tr:nth-child(odd) {background: #f2f2f2;} </style> </head> 

the answer simple: take <table> tags outside of php loop. should generating 1 set of <table> tags @ start , end of table, not every row. once this, css stands chance of working.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -