我在我的模型中写了一个雄辩的声明,它输出了大量的数据,这些数据完全模仿了我的输出。当我将其转储到后端时,它会返回正确的内容(如果你看下面的评论)。
但是当我尝试使用刀片为我的表格格式化时,它会在顶部剪切大量数据。它从中间的某个地方开始。
我尝试了很多样式,比如从引导程序中放入一些标准的CSS,什么都没有,因为我认为这是一个显示错误,但似乎没有。
Route::get('/', function () {
$hs = App\Wl_steige::all()->first();
$hs = $hs->getByStation('ptMetro')->groupBy('BEZEICHNUNG');
//dump($hs = $hs->getByStation('ptMetro')->groupBy('BEZEICHNUNG'))
return view('welcome', ['stellen' => collect($hs)]);
});
<div class="card">
<div class="card-body">
<table class="table table-dark">
<tbody>
@foreach($stellen AS $line => $stations)
<tr>
<th>Linie {{ $line }}</th>
</tr>
@foreach($stations AS $station)
<tr>
<td>{{ $station->NAME }}</td>
<td>{{ $station->VERKEHRSMITTEL }}</td>
<td>{{ $station->RBL_NUMMER }}</td>
<td>{{ $station->STEIG_WGS84_LAT }}</td>
<td>{{ $station->STEIG_WGS84_LON }}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
</div>
我预计它将从顶部开始,而不是在中间的某个地方。
前Laravel模板中有一个“隐藏的”text-align: center;
- 我不知道为什么但是让我的文字浮出屏幕。起初我没有看到它,因为它是在缓存的某个地方。在我第一次清除Laravels缓存文件php artisan cache:clear
然后Cmd + R
for Chrome之后,它对我来说很好。