如何根据具体价格更改单元格颜色?

我想根据特定值更改整个单元格的颜色。但是当语法错误并且不起作用时该怎么办呢?


在我的代码中


   echo "<tr  if( $row['treatment_fees_check_division'] == 'error') : style='yellow' >";

                echo "<td>" . $row['id'] . "</td>";

                echo "<td>" . $row['chart_num'] . "</td>"; 

                echo "<td>" . $row['chart_name'] . "</td>";                                        

                echo "<td>" .  substr($row['visit'], 0,10) . "</td>";

                echo "<td >" .  number_format($row['total_medical_bills']) . "</td>";

                echo "<td >" .  number_format($row['total_amount']) . "</td>";   

                echo "<td>" .  number_format($row['amount_asked']) . "</td>";

                echo "<td>" .  number_format($row['medical_bills_payment']) . "</td>";

                echo "<td>" .  number_format($row['personal_liability_amount']) . "</td>";                                                  

                echo "<td >" .  number_format($row['non_payment']) . "</td>";

                echo "<td >" .  number_format($row['non_payment_sales']) . "</td>";

                echo "<td>" . $row['insurance_division'] . "</td>";

                echo "<td>" . $row['division'] . "</td>";

                echo "<td>" .  number_format($row['cash_amount_received']) . "</td>";

                echo "<td>" .  number_format($row['cash_receipt']) . "</td>";

                echo "<td>" .  number_format($row['cash_receipt_non_payment']) . "</td>";

                echo "<td>" .  number_format($row['cash_receipt_payment']) . "</td>";

                echo "<td>" .  number_format($row['card_amount_received']) . "</td>";

                echo "<td>" .  number_format($row['card_non_payment']) . "</td>";

                echo "<td>" .  number_format($row['card_payment']) . "</td>";

                echo "<td>" .  number_format($row['treatment_fees_difference']) . "</td>";

                echo "<td>" .  $row['treatment_fees_check_division'] . "</td>";                

                echo "</tr>";


HUX布斯
浏览 89回答 1
1回答

www说

尝试用这样的内容替换你的第一行。if ($row['treatment_fees_check_division'] == 'error') {&nbsp; &nbsp; &nbsp;echo "<tr style='yellow' >";} else {&nbsp; &nbsp; &nbsp;echo "<tr >";}
打开App,查看更多内容
随时随地看视频慕课网APP