我有一张表,其中一列仅包含日期时间。我想隐藏日期,仅在移动设备(使用Bootstrap)上显示时间。我找到了该类,visible-lg
并尝试使用<span>
的。
但是为什么他们不在同一条线上呢?
<table class="table table-striped">
<thead>
<tr>
<th>Timestamp</th>
<th>Value A</th>
<th>Value B</th>
<th>Value C</th>
</tr>
</thead>
<tbody>
<tr data-timestamp="1390158176">
<td><span class="visible-lg">01.19.14</span><span>20:02:56</span></td>
<td>22.5</td>
<td>950.91</td>
<td>531.66</td>
</tr>
</tbody>
</table>
我也试图把两个<span>
在一个人的<span>
即在<td>
。我还尝试将时间跨度延长到时间之后<td>
。我希望他们在同一条线上。宽屏用户应该注意,如果在小型浏览器中显示该页面,则该日期将被隐藏。
要隐藏日期并仅在移动设备上显示时间,请使用hidden-xs类:
<td><span class="hidden-xs">01.19.14</span><span>20:02:56</span></td>
当.hidden-xs
被应用的样式,你会发现,bootstrap.css将其显示到块导致span
标签占用列的整个宽度。尽管通常不建议这样做,但是我看到的唯一选择(除了使用其他媒体查询之外)是在使用!important
自家的子类中进行扑朔迷离的战斗。
的HTML
<td><span class="hidden-xs hidden-xs-inline">01.19.14</span><span> 20:02:56</span></td>
的CSS
.hidden-xs-inline{
display: inline-block !important;
}
JS小提琴: http : //jsfiddle.net/3e6dz/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句