gpt4 book ai didi

css - 更改小屏幕上的表格布局

转载 作者:行者123 更新时间:2023-11-28 08:12:23 25 4
gpt4 key购买 nike

在小型设备上,我需要 <td><%= link_to post.heading, post %></td>出现在该行之前代码中的图像下方...目前它显示与图像一致..我想我需要先将表格与图像堆叠然后post.heading我也想要 <td><%= link_to post.heading, post %></td>在需要换行时换行/换行

 <div class="table-responsive">
<table class="table shrink table-striped">
.....
<tbody>
<% @posts.each do |post| %>
<tr>

<td width="13%" height="120px">
<% if post.images.empty? %>
<%= image_tag "http://s12.postimg.org/hqk7wkk4t/no_car_photo.gif", class: "thumbnail", class: "img-responsive" %>
<% else %>
<%= image_tag post.images.first.url, class: " img-responsive" %>
<% end %>
</td>

<td><%= link_to post.heading, post %></td>

html 输出是:

      <table class="table shrink table-striped">
<thead>
<tr>
<th>Preview</th>
<th>Heading</th>
<th class= "hidden-xs">Price</th>
<th class= "hidden-xs">Make</th>
<th class= "hidden-xs">Model</th>
<th class= "hidden-xs">Year</th>
<th class= "hidden-xs">Mileage</th>
<th class= "hidden-xs">Transmission</th>
<th class= "hidden-xs">Title Status</th>
<!-- <th> Neighborhood</th> -->
<th class= "hidden-xs">Last Updated</th>

</tr>
</thead>

<tbody>
<tr>

<td width="13%" height="120px">
<img alt="00r0r bdmpio6ljkp 600x450" class=" img-responsive" src="http://images.craigslist.org/00r0r_bdmpIO6lJkp_600x450.jpg" />
</td>

<td class="col-xs-4"><a href="/posts/8732">2008 Jeep Liberty as low as of $500 Down and $296.00 per month</a></td>

<td class= "hidden-xs">$11,995</td>
<td class= "hidden-xs">Jeep</td>
<td class= "hidden-xs">Liberty</td>
<td class= "hidden-xs">2008</td>
<td class= "hidden-xs">71966</td>
<td class= "hidden-xs"></td>
<td class= "hidden-xs">clean</td>
<!--<td></td> -->
<td class= "hidden-xs">about 14 hours ago</td>
</tr>
<tr>

最佳答案

<% @posts.each do |post| %>
<tr>

<td width="10%" height="100%">
<% if post.images.empty? %>
<%= image_tag "http://s12.postimg.org/hqk7wkk4t/no_car_photo.gif", class: "thumbnail", class: "img-responsive" %>
<% else %>
<%= link_to (image_tag(post.images.first.url)), post, class: "img-responsive", class: "thumbnail" %>
<% end %>
</td>

<td class= "hidden-xs"><%= link_to post.heading, post %></td>

<td class= "hidden-xs"><%= number_to_currency(post.price, precision: 0 ) %></td>
<td class= "hidden-xs"><%= post.make %></td>
<td class= "hidden-xs"><%= post.model %></td>
<td class= "hidden-xs"><%= post.year %></td>
<td class= "hidden-xs"><%= post.mileage %></td>
<td class= "hidden-xs"><%= post.transmission %></td>
<td class= "hidden-xs"><%= post.title_status %></td>
<!--<td><%= post.neighborhood %></td> -->
<td class= "hidden-xs"><%= "#{time_ago_in_words (Time.at(post.timestamp.to_i))} ago" %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

关于css - 更改小屏幕上的表格布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29194573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com