處理當一個表格的寬度超過跨度的寬度,這樣的頁面:http://jsfiddle.net/rcHdC/響應表中Twitter的引導
你會看到表的內容是span
之外。
會是什麼,以迎合這種情況下,最好的方法是什麼?
處理當一個表格的寬度超過跨度的寬度,這樣的頁面:http://jsfiddle.net/rcHdC/響應表中Twitter的引導
你會看到表的內容是span
之外。
會是什麼,以迎合這種情況下,最好的方法是什麼?
可用的一個選項是fooTable。在響應網站的偉大工程,並允許您設置多個斷點... fooTable Link
[FooTable現在可以與開箱即用的Twitter Bootstrap一起使用。](http://fooplugins.com/footable/demos/getting-started.htm#setup) – 2014-08-21 10:42:38
有很多不同的東西與響應表打交道時,你可以做。
我個人很喜歡這種方法由克里斯Coyier:
您可以在這裏找到許多其他的替代品:
如果你可以利用引導並迅速得到的東西,你可以簡單地使用類名「.hidden手機」和「.hidden片劑」隱藏某些行,但這種方法可能是最好的在許多情況下。更多信息(請參閱 「響應實用工具類」):
Coyer Link的+1。我以前用過這個效果很好。 – 2013-10-15 09:57:16
是的,Chris Coyer的解決方案非常整齊。比bootstrap或zurbfoundation提供的更好(它們只是添加水平滾動)。 – 2015-04-09 16:00:39
截至目前,2016年1月,Coyier和其他人的響應材料是5 - 6歲,在每個人開始使用Twitter Bootstrap之前。 – 2016-01-31 19:30:04
Bootstrap 3現在有響應表開箱。萬歲! :)
您可以點擊此處查看:https://getbootstrap.com/docs/3.3/css/#tables-responsive
添加<div class="table-responsive">
圍繞你的表,你應該是好去:
<div class="table-responsive">
<table class="table">
...
</table>
</div>
爲了讓你能做到這一切的佈局工作:
.table-responsive
{
overflow-x: auto;
}
但它只適用於小型設備(768px以下):S來源:http://getbootstrap.com/css/#tables-responsive – VSP 2013-12-09 15:16:07
要在所有大小的佈局上啓用此功能,您只需從768阻止在foundation_and_overrides.css.scss文件中。類似於「''\t。表格響應{ \t寬度:100%; \t \t overflow-y:hidden; \t \t overflow-x:scroll; \t \t -ms-overflow-style:-ms-autohiding-scrollbar; \t \t -webkit-overflow-scrolling:touch; \t} ''' – genkilabs 2014-02-14 21:19:29
@ ase69s檢查我的更新答案。剛纔我需要一張有很多列的桌子。在自定義的'CSS'文件中添加'overflow-x:auto'會爲更大的顯示佈局帶來訣竅。 – 2014-04-14 23:31:08
如果您正在使用引導3以上,你可以通過updatingthe文件應用的響應表中的所有決議案:
tables.less
或覆蓋該部分:
@media (max-width: @screen-xs) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
overflow-x: scroll;
border: 1px solid @table-border-color;
// Tighten up spacing and give a background color
> .table {
margin-bottom: 0;
background-color: #fff;
// Ensure the content doesn't wrap
> thead,
> tbody,
> tfoot {
> tr {
> th,
> td {
white-space: nowrap;
}
}
}
}
// Special overrides for the bordered tables
> .table-bordered {
border: 0;
// Nuke the appropriate borders so that the parent can handle them
> thead,
> tbody,
> tfoot {
> tr {
> th:first-child,
> td:first-child {
border-left: 0;
}
> th:last-child,
> td:last-child {
border-right: 0;
}
}
> tr:last-child {
> th,
> td {
border-bottom: 0;
}
}
}
}
}
}
有了:
@media (max-width: @screen-lg) {
.table-responsive {
width: 100%;
...
注意我是如何改變的第一行@屏幕-XX值。
我知道讓所有表響應聽起來不是那麼好,但我發現它非常有用的這個中啓動的LG大表(大量列)。
希望它可以幫助別人。
你想要發生什麼? – cimmanon 2013-03-02 17:37:49