railsを使ったサイトで、デザインにbootstrapを使用しているのですが、each文で各列毎に挿入したい「名前」が、以下のようになってしまいます。
テーブルの列毎に任意の名前が入るようにしたいのですがどうしたらいいでしょうか?
<!--table--> <div class="opp bg-dark" style="padding:200px" > <div class="container"> <div class="row"> <div class="col-sm-2"></div> <div class="col-sm-8"> <div class="table-responsive"> <table class="table table-bordered"> <thead> <tr> <th style="padding:20px 10px">写真</th> <th style="padding:20px 10px display: table-cell; vertical-align: middle; text-align: center;">名前</th> <th style="padding:20px 10px"></th> </tr> </thead> <tbody> <tr> <td>写真</td> <td style="padding:20px 10px display: table-cell; vertical-align: middle; text-align: center;"> <% @posts.each do |post| %> <div class="posts-index-item"> <%= post.content %> <% end %> </div> </td> <td> <div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown"> 詳細 <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li role="presentation"><a href="#"> <% @posts.each do |post| %> <div class="posts-index-item"> <%= post.content %> </div> <% end %> </a></li> </ul> </div> </td> </tr> </tbody> </tab![イメージ説明](318f7fa5dfb47a7e524acd44f73f4b6c.png) </div> </div> <div class="col-sm-2"></div> </div> </div> </div> </div> <!--table.end-->
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/09/18 03:20