How to set alternate row color for an iterated table in php?

前端 未结 3 1790
广开言路
广开言路 2021-01-21 23:51

I am using PHP and I am iterating a table with a result array ... I want to add row color and alternate row color to it.... How to do so? Any suggestion...



        
3条回答
  •  广开言路
    2021-01-22 00:16

    SelectQuery();
    $ID = $i;
    $i = 1;
    ?>
    ' . "\r\n";
        $i++;
      }else{  # An even row 
        $rowColor = "green";
        echo '' . "\r\n";
        $i++;
      } 
    }
    ?>  
    
    ID NAME DESCRIPTION
    ' . $row["ID"] . '' . $row["Name"] . '' . $row["Description"] . '
    ' . $row["ID"] . '' . $row["Name"] . '' . $row["Description"] . '

提交回复
热议问题