tableタグ サイズ調整したい
下記のように書くと、画面いっぱいに表示されてしまう…
中心にまとめたいなぁ、、、
<h2>投稿一覧</h2>
<table class="table">
<thead>
<th>画像</th>
<th>タイトル</th>
<th>カテゴリー</th>
<th>本</th>
<th>本文</th>
</thead>
<tbody>
<% @spots.each do |spot| %>
<tr>
<td><%= image_tag spot.image, size: '150x100'%></td>
<td><%= spot.name %></td>
<td><%#= spot.category.try(:name) %></td>
<td><%= spot.quality %></td>
<td><%= spot.introduction %></td>
</tr>
<% end %>
</tbody>
</table>
ということで調べていきました!
<h2>投稿一覧</h2>
-------ここから-------
<div class="container text-center">
<div class="row">
<div class="col-md-12">
-------ここを追加--------
<table class="table">
<thead>
<th>画像</th>
<th>タイトル</th>
<th>カテゴリー</th>
<th>本</th>
<th>本文</th>
</thead>
<tbody>
<% @spots.each do |spot| %>
<tr>
<td><%= image_tag spot.image, size: '150x100'%></td>
<td><%= spot.name %></td>
<td><%#= spot.category.try(:name) %></td>
<td><%= spot.quality %></td>
<td><%= spot.introduction %></td>
</tr>
<% end %>
</tbody>
</table>
----これも追加-----
</div>
</div>
</div>
-----ここまで追加-----
こんな感じに中心にコンパクトに表示されました★