bootstrap 4を使用しています。
table内の、テキストを中央揃えにしたいのですが、text-alignは効いても、vertical-alignが効きません。誤りをご指摘頂けますと幸甚です。
html
1<div class="col-lg-7 col-xs-12"> 2 <table class="table table-sm table-bordered"> 3 <tr> 4 <th class="p-details"><h6>出品者</h6></th> 5 <td class="p-details"><h6><%= link_to @product.user.user_name, [:user, @product.user] %>さん</h7> 6 <%= link_to "不要画面テスト", [@product.user, :user_products] %>さん</h7></td> 7 </tr> 8 <tr> 9 <th class="p-details"><h6>カテゴリー</h6></th> 10 <td><h6>イヤリング</h6></td> 11 </tr> 12 <tr> 13 <th class="p-details"><h6>ブランド</h6></th> 14 <td><h6><%= @product.brand%></h6></td> 15 </tr> 16 <tr> 17 <th class="p-details"><h6>商品の状態</h6></th> 18 <td><h6><%= @product.status == 1 ? "新品同様" : 2? "目立つ傷あり" : "test" %></h6></td> 19 </tr> 20 <tr> 21 <th class="p-details"><h6>発送予定</h6></th> 22 <td><h6><%= @product.dispatch == 1? "即日" : 2? "1週間以内" : "test" %></h6></td> 23 </tr> 24 <tr> 25 <th class="p-details"><h6>コメント</h6></th> 26 <td><h6><%=@product.memo%></h6></td> 27 </tr class="p-details"> 28 <tr> 29 <th><h6>掲載日</h6></th> 30 <td><h6><%= @product.posted_at.strftime("%Y/%m/%d %H:%M")%></h6></td> 31 </tr> 32 </table> 33 </div><!--col-->
css
1.p-details{ 2 height: 1.5rem; 3 line-height: 1.5rem; 4 text-align: center; 5 vertical-align: middle; 6} 7

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/11/09 03:52
2016/11/09 03:58
2016/11/09 04:02
2016/11/09 04:54
2016/11/09 05:54
2016/11/09 06:20
2016/11/09 12:13
2016/11/09 12:26
2016/11/09 13:21
2016/11/09 13:22
2016/11/09 13:31
2016/11/09 14:00
2016/11/09 14:18
2016/11/09 14:58