Change table row color based on value

前端 未结 1 1365
春和景丽
春和景丽 2021-01-29 07:23

I have a table that looks something like this:

ID     |     photo      |   ident     | status
------------------------------------------------
80     |    img/pho         


        
1条回答
  •  一个人的身影
    2021-01-29 07:40

    You can use your status var as a class and add the colors for the classes in css like this

    .color-v {
      background-color: blue;
    }
    
    .color-x {
      background-color: green;
    }
    query($query)) {
              $num_rows = 0;
              while ($row = $result->fetch_assoc()) {
                  $num_rows++;
                  echo
                  "";
                 
              }
              /*freeresultset*/
              $result->free();
          }
        ?>
      
    Photo Ident Status
    {$row['photo']} {$row['ident']} {$row['status']}

    0 讨论(0)
提交回复
热议问题