根据单元格值突出显示行 - Perl 脚本

highlight row based on cell value - Perl Script

当 F 列显示 F 的值时,我无法突出显示一行。我知道我可以通过 CSS/JS 完成此操作,但将 运行 保留在砖墙上。我对编码很陌生,如果可能的话希望得到一些帮助。

目标: 当 F 列显示 F 的值时,需要将整行突出显示为黄色。

提前致谢!!!

    <div class='row'>
                <div class='col-lg-12 col-sm-12'>
                    <div class='panel panel-primary'>
                        <div class='panel-heading'>
                            <h3 class='panel-title'><i class='fa fa-bar-chart-o'></i>Priority Lots</h3>
                        </div>
                        
                        <table class='table'>
                            <thead>

                            <tr>
                                    <th>LOT</th>
                                    <th>LPT</th>
                                    
                                    <th>OPN</th>
                                    <th>DEVICE</th>
                                    <th>QTY</th>
                                    <th>DTTM</th>

                                    <th>I</th>
                                    <th>H</th>
                                    <th>F</th>
                                    <th>P</th>

                                    <th>S</th>
                                    <th>LOCATION</th>
                                    <th>STATUS</th>
                                    <th>EQUIP</th>
                                </tr>
                            </thead>
                            
                    </div>";
                    
                    
$sqlstr="select l.lot, l.lpt, lc.opn, ls.device, l.cur_qty as qty, 
round((sysdate - l.last_act_dttm)*24,1) as dttm, 
l.isc as i, l.hold as h, l.ftr_hold as f, ls.priority as p, 
ls.swr as s, ls.lot_code3 as location, 
decode (lc.lot_status,'P',' Processing ') as status, lc.equip
from lot l, lot_str ls, lot_cur_opn lc, lpt_grp_lpt_lst lg  
where l.facility = 'DP1DM5' and lc.facility = l.facility 
and ls.facility = l.facility and lg.lpt_grp_facility = 'DP1DM5'
and l.lot = ls.lot and l.lot = lc.lot 
and ls.latest = 'Y' and ls.priority != 'N' 
and ls.priority IN ('0','1','2','3')
and l.lpt < 'TRM' and ls.latest = 'Y' and l.lpt = lg.lpt
and lg.lpt_grp_type = 'G' and lg.lpt_grp = '3005'
order by p, lpt

";
$sth = $dbh->prepare($sqlstr);
$sth->execute();
$sth->bind_columns(undef, $LOT, $LPT, $OPN, $DEVICE, $QTY, $DTTM, $I, $H, $F, $P, $S, $LOCATION, $STATUS, $EQUIP);

while($sth->fetch()) {
    

   print "
                    
        <tbody>
                            
        <tr class='row100 body'>
                                    <td class='cell100 column4'>$LOT</td>
                                    <td class='cell100 column4'>$LPT</td>
                                    <td class='cell100 column4'>$OPN</td>
                                    <td class='cell100 column4'>$DEVICE</td>
                                    <td class='cell100 column4'>$QTY</td>
                                    <td class='cell100 column4'>$DTTM</td>
                                    <td class='cell100 column4'>$I</td>
                                    <td class='cell100 column4'>$H</td>
                                    <td class='cell100 column4'>$F</td>
                                    <td class='cell100 column4'>$P</td>
                                    <td class='cell100 column4'>$S</td>
                                    <td class='cell100 column4'>$LOCATION</td>
                                    <td class='cell100 column4'>$STATUS</td>
                                    <td class='cell100 column4'>$EQUIP</td>
                                    
                                  
                                    

      


   </tr>";

   
}

                  

                    print "</tbody>
                        </table>
                        
                    </div>
                    <BR>
                    <BR>
                    </div>

下面是 F 栏的截图:

在创建简单的存根 HTML 页面时,这会以黄色或非黄色突出显示该行。

  my ($LOT, $LPT, $OPN, $DEVICE, $QTY, $DTTM, $I, $H, $F, $P, $S, $LOCATION, $STATUS, $EQUIP) = ('LOT', 'LPT', 'OPN', 'DEVICE', 'QTY', 'DTTM', 'I', 'H', 'F', 'P', 'S', 'LOCATION', 'STATUS', 'EQUIP');
  print "<html><body><table>\n";

# while($sth->fetch()) {
my $highlight = $F eq 'F' ? ' BGCOLOR="#FFFF00"' : '';
print "
        <tbody>
        <tr$highlight class='row100 body'>
                                    <td class='cell100 column4'>$LOT</td>
                                    <td class='cell100 column4'>$LPT</td>
                                    <td class='cell100 column4'>$OPN</td>
                                    <td class='cell100 column4'>$DEVICE</td>
                                    <td class='cell100 column4'>$QTY</td>
                                    <td class='cell100 column4'>$DTTM</td>
                                    <td class='cell100 column4'>$I</td>
                                    <td class='cell100 column4'>$H</td>
                                    <td class='cell100 column4'>$F</td>
                                    <td class='cell100 column4'>$P</td>
                                    <td class='cell100 column4'>$S</td>
                                    <td class='cell100 column4'>$LOCATION</td>
                                    <td class='cell100 column4'>$STATUS</td>
                                    <td class='cell100 column4'>$EQUIP</td>
   </tr>";
}
print "</tbody></table>\n";
#
  print "</body></html>\n";