Reputation: 1749
Below image show an error to render a "/th>" tag in red circle and blank space to each /td tag in the each rows when I use "Laravel-dompdf".
I thought it came from rendering problem in end of tag when before finished Carbon calculate.
How can I modify to make clear table?
Laravel version: 5.4, plugin: laravel-dompdf.
<h3>Fullført Jobber</h3>
<div style="overflow-x: auto;">
<table class="table table-responsive" id="jobs-table">
<tr>
<th>Jobb ID</th>
<th>Brukernavn</th>
<th>Kundenavn</th>
<th>Jobbsted</th>
<th>Jobbtype</th>
<th>Note 1</th>
<th>Time Start</th>
<th>Time brukt</th>
</tr>
@foreach($jobs as $job)
@if(!$job->deleted_at == null)
<tr>
<td>{!! $job->id !!}</td>
<td>{!! $job->user_name !!}</td>
<td>{!! $job->customer_name !!}</td>
<td>{!! $job->job_place !!}</td>
<td>{!! $job->job_type !!}</td>
<td>{!! $job->note_1 !!}</td>
<td>{!! $job->created_at !!}</td>
<td>{!! \Carbon\Carbon::parse($job->deleted_at)->diff(\Carbon\Carbon::parse($job->created_at))->format('%H:%I:%S')!!}<td>
</tr>
@endif
@endforeach
</table>
Upvotes: 2
Views: 979
Reputation: 21681
You have not close your td tag for last column in following line:
<td>{!! \Carbon\Carbon::parse($job->deleted_at)->diff(\Carbon\Carbon::parse($job->created_at))->format('%H:%I:%S')!!}<td>
So use like this:
<td>{!! \Carbon\Carbon::parse($job->deleted_at)->diff(\Carbon\Carbon::parse($job->created_at))->format('%H:%I:%S')!!}</td>
As you forgot to add /
in <td>
for last column, it is creating new column which is coming as blank in last of each row.
Upvotes: 2