在条件不起作用的情况下在数据表行中添加内联CSS

时间:2017-09-25 08:54:22

标签: php

我试图突出显示某些列具有除NULL以外的某些值的记录。我正在使用dataTable插件。

 <table class="table table-striped table-hover" id="checkin-checkout-record-table">
    <thead>
        <tr>
        <th>Employee Name</th>
        <th>Check-in-date</th>
        <th>Check-in-time</th>
        <th>Check-out-date</th>
        <th>Check-out-time</th>
        <th class="col-lg-2">Late Check-in Remarks</th>
        <th class="col-lg-2">Early Check-out Remarks</th>
        </tr>
        </thead>
  <tbody>

        <?php
        foreach ($checkinCheckoutList as $member): ?>
        <tr <?php
       if(isset($member['early_checkout_remarks']) ||isset($member['delayed_checkin_remarks']))
        {?>
        style="background-color:red;"
        <?php } ?> >
        <td><?php echo $member['fullname'] ?></td> 
        <td> <?php echo $member['checkin_date']; ?></td>
        <td> <?php echo $member['checkin_time']; ?></td>
        <td><?php echo $member['checkout_date']; ?></td>
        <td><?php echo $member['checkout_time']; ?></td>
        <td><?php echo $member['delayed_checkin_remarks']; ?></td>
        <td><?php echo $member['early_checkout_remarks']; ?></td>
        </tr>
        <?php endforeach; ?>
  </tbody>

但结果并不像预期的那样。某些记录未突出显示。这适用于其他普通表。请帮忙。

0 个答案:

没有答案