问题描述
需要帮助设计网站页面上的文字,我显示表格的数据,它们看起来不太好(附截图)帮助 我的视图文件:
@extends('layouts.layout')
@section('title')Бізнес@endsection
@section ('main_content')
<h1>Бизнес</h1>
<p>
@foreach ($business as $singleBusiness)
<li>{{ $singleBusiness->id}}</li>>
<li>{{ $singleBusiness->name}}</li>>
<li>{{ $singleBusiness->mail}}</li>>
<li>{{ $singleBusiness->website}}</li>>
@endforeach
</p>
@endsection
my plate looks like this,all records are vertical(
解决方法
所以,laravel 有自举程序,所以你可以使用它。这是获得好桌子的最简单方法
您可以从该页面获取 tabel html,然后将您的数据放入其中
https://getbootstrap.com/docs/4.5/content/tables/
就像这样
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">name</th>
<th scope="col">mail</th>
<th scope="col">website</th>
</tr>
</thead>
<tbody>
@foreach ($business as $singleBusiness)
<tr>
<th scope="row">{{ $singleBusiness->id}}</th>
<td>{{ $singleBusiness->name}}</td>
<td>{{ $singleBusiness->mail}}</td>
<td>{{ $singleBusiness->website}}</td>
</tr>
@endforeach
</tbody>
</table>