2016-05-26 3 views
1

Mobileのすべてのカラムを表示できるように、モバイル/タブレットでHTMLテーブルを転記することは可能ですか?下の画像は私が達成しようとしている例です。 A Example of Desktop and Mobileモバイル/タブレットビューのHTMLテーブルをブートストラップに転記

+0

HTMLテーブルの行と列を逆変換(転置)する方法はありますか?](http://stackoverflow.com/questions/6297591/how-to-invert-transpose-therows-and-columns- of-an-html-table) –

答えて

1

htmlのtableタグにtable-responsiveというクラスを追加してみてください。 テーブルを応答するためのブートストラップクラスです。

0

これですべてが必要です。あなたの必要性にぴったりです、あなたはそれを愛するでしょう。

チェックこのリンク - fooのテーブルライブラリ/プラグイン:https://css-tricks.com/footable-a-jquery-plugin-for-responsive-data-tables/

+0

これはオプションですが、ユーザーの決定はすべてのフィールドに基づいているため、列を非表示にしたくありません。 –

+0

次に、これを実装して、ページ設定付きのカスタムテーブルを作成できます。 Onclick次に、ajaxで新しいデータ値を読み込むことができます。あなたが実装したい言語は何ですか? Php –

+0

いいえ、私はAngularJSを使用してこれを行いたい、そしてAPIはJSON配列を送信します。 –

0

このリンクはあなたが必要とするのに役立ちます

TABLES RESPONSIVES WIDTH 100%

index.htmlを

<table> 
    <thead> 
     <tr> 
      <th>Code</th> 
      <th>Company</th> 
      <th class="numeric">Price</th> 
      <th class="numeric">Change</th> 
      <th class="numeric">Change %</th> 
      <th class="numeric">Open</th> 
      <th class="numeric">High</th> 
      <th class="numeric">Low</th> 
      <th class="numeric">Volume</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr> 
      <td>AAC</td> 
      <td>AUSTRALIAN AGRICULTURAL COMPANY LIMITED.</td> 
      <td class="numeric">$1.38</td> 
      <td class="numeric">-0.01</td> 
      <td class="numeric">-0.36%</td> 
      <td class="numeric">$1.39</td> 
      <td class="numeric">$1.39</td> 
      <td class="numeric">$1.38</td> 
      <td class="numeric">9,395</td> 
     </tr> 
    </tbody> 
</table> 

css.css

@media only screen and (max-width: 800px) { 
    #unseen table td:nth-child(2), 
    #unseen table th:nth-child(2) {display: none;} 
} 

@media only screen and (max-width: 640px) { 
    #unseen table td:nth-child(4), 
    #unseen table th:nth-child(4), 
    #unseen table td:nth-child(7), 
    #unseen table th:nth-child(7), 
    #unseen table td:nth-child(8), 
    #unseen table th:nth-child(8){display: none;} 
} 
関連する問題