2012-12-18 50 views
2

如何使用Jquery mobile作爲響應樣式表?如何使用Jquery mobile將表格作爲響應樣式?

目前我正在爲magento定製一個jquery移動主題。但表格不響應。當手機屏幕太小時,會出現水平滾動。

我從here以及jquery.mobile-1.0b3.min.css中添加了一個css。

.ui-table { 
    border: 0; 
    border-collapse: collapse; 
    padding: 0; 
    width: 100%; 
} 
.ui-table th, 
.ui-table td { 
    line-height: 1.5em; 
    text-align: left; 
    padding: .4em .5em; 
    vertical-align:top; 
} 
.ui-table th { 
    font-weight: bold; 
} 
.ui-table caption { 
    text-align:left; 
    margin-bottom:1.4em; 
    opacity:50%; 
} 

/* Add strokes between each row */ 
.table-stroke thead th { 
    border-bottom: 1px solid #d6d6d6; /* non-RGBA fallback */ 
    border-bottom: 1px solid rgba(0, 0, 0, .1); 
} 
.table-stroke tbody th, 
.table-stroke tbody td { 
    border-bottom: 1px solid #e6e6e6; /* non-RGBA fallback */ 
    border-bottom: 1px solid rgba(0, 0, 0, .05); 
} 


/* Add alternating row stripes */ 
.table-stripe tbody tr:nth-child(odd) td, 
.table-stripe tbody tr:nth-child(odd) th { 
    background-color: #eeeeee; /* non-RGBA fallback */ 
    background-color: rgba(0,0,0,0.04); 
} 
/* Add stroke to the header and last item */ 
.table-stripe thead th, 
.table-stripe tbody tr:last-child { 
    border-bottom: 1px solid #d6d6d6; /* non-RGBA fallback */ 
    border-bottom: 1px solid rgba(0, 0, 0, .1); 
} 

但它仍然無法正常工作。我的CSS和JS們,

  1. jquery.mobile-1.0b3.min.css
  2. jQuery的1.6.2.min.js
  3. jquery.mobile-1.0b3.min.js

我錯過了什麼嗎?

+0

德在這裏看看:http://css-tricks.com/footable-a-jquery-plugin-for-responsive-data-tables/。這不僅是關於造型,還應該在這裏做一些更多的工作... – shadyyx

+0

對不起。風格側邊jquery手機是不允許在這個項目中:(:() –

+0

響應式設計不是關於jQuery或jQuery手機,所以閱讀文章,尋找其他解決方案(如[Chris Coyier](http://css-tricks.com/responsive-data-tables/)的解決方案 - 他的解決方案只是關於CSS!)。不要等待有人會在這裏爲你寫出整個解決方案... – shadyyx

回答

相關問題