I am able to display my data from db. I want to display in a table under tabs but then my data appears crooked. The rows are not straight. why is that happening to the table?
it is arranged kind of this way.
the updated code below doesn't provide the right format for the table Table
id name
1 James
4 Michel
2 Jonathan
HTML
<div class="row">
<div class="col-md-7">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
@foreach($items as $item)
<li><a href="#tab_{{ $item->id }}" data-toggle="tab" >{!!$item->name!!}</a></li>
@endforeach
</ul>
<div class="tab-content">
@foreach($items as $item)
<div class="tab-pane active" id="tab_{{ $item->id }}">
@foreach($item->products as $product)
<table class="table">
<thead>
<tr>
<th>No#</th>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{$product->id }}</td>
<td>{{ $product->name}}</td>
</tr>
</tbody>
</table>
@endforeach
</div>
@endforeach
</div>
</div>
</div>
Updated Code
Update
<div class="row">
<div class="col-md-7">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
@foreach($items as $item)
<li><a href="#tab_{{ $item->id }}" data-toggle="tab" >{!!$item->name!!}</a></li>
@endforeach
</ul>
<div class="tab-content">
@foreach($items as $item)
<div class="tab-pane active" id="tab_{{ $item->id }}">
<table class="table">
<thead>
<tr>
<th>No#</th>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach($item->products as $product)
<tr>
<td>{{$product->id }}</td>
<td>{{ $product->name}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endforeach
</div>
</div>
</div>