<div class="table-responsive">
<table id="Well_CAT" class="table table-striped table-bordered">
<thead> <th>Client_Contract_Number</th>
<th>Currently_Using</th>
<th>MBPS_EAM_Number_RIGT</th>
<th>Model_and_Type</th>
<th>LFour_Yearly</th>
<th>Six_Monthly</th>
<th>One_Yearly</th>
<th>One_and_Half_Yearly</th>
<th>Two_Yearly</th>
<th>Two_and_Half_Yearly</th>
<th>Three_Yearly</th>
<th>Three_and_Half_Yearly</th>
<th>Four_Yearly</th>
<th>Remarks</th>
</thead>
<?php
while($rows=mysql_fetch_array($result)){
?><tr>
<td class="exdate"><? echo $rows['Client_Contract_Number']; ?></td>
<td class="exdate"><? echo $rows['Currently_Using']; ?></td>
<td><? echo $rows['MBPS_EAM_Number_RIGT']; ?></td>
<td><? echo $rows['Model_and_Type']; ?></td>
<td><? echo $rows['LFour_Yearly']; ?></td>
<td class="exdate"><? echo $rows['Six_Monthly']; ?></td>
<td class="exdate"><? echo $rows['One_Yearly']; ?></td>
<td class="exdate"><? echo $rows['One_and_Half_Yearly']; ?></td>
<td class="exdate"><? echo $rows['Two_Yearly']; ?></td>
<td class="exdate"><? echo $rows['Two_and_Half_Yearly']; ?></td>
<td class="exdate"><? echo $rows['Three_Yearly']; ?></td>
<td class="exdate"><? echo $rows['Three_and_Half_Yearly']; ?></td>
<td class="exdate"><? echo $rows['Four_Yearly']; ?></td>
<td class="exdate"><? echo $rows['Remarks']; ?></td>
</tr>
<?php
}
?>
</table>
下面是我的表格,它是为了跟踪证书的有效性,从四年一次到四年一次的列是日期字段,我想根据有效性设置这些字段的条件颜色格式。。。比如有效期-绿色,过期-红色。
1条答案
按热度按时间aiazj4mn1#
由于php>=5.2.0,因此可以使用datetime类:
传递给datetime构造函数的字符串将根据这些规则进行解析。
下面是一个代码示例: