我想打印一个包含表格的页面,但是当我打印时它总是变成了bootstrap的默认颜色。我使用ctrl+p/cmd+p进行打印,使用的是bootstrap 4和laravel 5.7。
我尝试过使用!important;
但仍然不起作用。
我的CSS:
<style media="screen">
@media print{
.table thead tr td,.table tbody tr td {
border: 1px solid #000000!important;
}
}
</style>
我的表格
<table class="col-12 table table-bordered table-sm" >
<thead class="thead-light">
<tr>
<th>Description</th>
<th>Quantity</th>
<th>Unit Price (IDR)</th>
<th>Amount (IDR)</th>
</tr>
</thead>
@php
$total=0;
@endphp
@foreach($ra->sale->details as $items)
<tr>
<td>{{ $items->good->name }}</td>
<td>{{ $items->qty }} pcs</td>
<td>{{ number_format($items->units,0,',','.') }}</td>
<td>{{ number_format($items->total,0,',','.') }}</td>
</tr>
@php
$total += $items->total;
@endphp
@endforeach
</table>