HTML单元格怎么加单元格,如何根据其值在HTML单元格中添加类
生活随笔
收集整理的這篇文章主要介紹了
HTML单元格怎么加单元格,如何根据其值在HTML单元格中添加类
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我有以下循環,其中我從查詢中提取值并用表編寫表,在該字段中,我需要根據從發貨日期到今天為止所經過的天數,更改年齡的字段
我已經在CSS中嘗試過了[data-age> 180],但是我只遇到錯誤,而且找不到與我的需求類似的情況,另外,id喜歡在循環內進行操作,而不是另外的代碼,因為它弄亂了我的視線
@foreach($shipments as $shipment)
{{$shipment->id}}{{$shipment->tracking}}{{$shipment->PartNumber}}{{$shipment->DateShipped}}data-title="age"
data-age="{{
(int) floor(
(time() - strtotime($shipment->DateShipped))
/ (60 * 60 * 24)
)
}}"
>{{
(int) floor(
(time() - strtotime($shipment->DateShipped)) / (60 * 60 * 24)
)
}} days
{{$shipment->Qtyorder}}{{$shipment->QtyShipped}}{{$shipment->QtyBckorder}}{{$shipment->purchaseOrder}}{{$shipment->OrderNumber}}{{$shipment->paperwork}}{{$shipment->VMIreceived}}{{$shipment->VMIticketNumber}}{{$shipment->VMILRB}}href="{{ route('shipment.edit',$shipment->id)}}"
class="btn btn-primary"
>
Edit
@csrf
@method('DELETE')
Delete
@endforeach
總結
以上是生活随笔為你收集整理的HTML单元格怎么加单元格,如何根据其值在HTML单元格中添加类的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 单片机与普通微型计算机不同在于,单片机与
- 下一篇: html5引入外联样式的优先级,CSS的