Materialdesignlite-datatables

提供:Dev Guides
移動先:案内検索

マテリアルデザインライト-DataTable

MDLは、事前定義されたさまざまな視覚的および動作の強化を適用し、テーブルをデータテーブルとして表示するための一連のCSSクラスを提供します。 次の表に、使用可能なクラスとその効果を示します。

Sr.No. Class Name & Description
1

mdl-data-table

テーブルをMDLコンポーネントとして識別し、テーブル要素で必要です。

2

mdl-js-data-table

基本的なMDL動作をテーブルに設定し、テーブル要素で必要です。

3

mdl-data-table—​selectable

すべて/個々の選択可能な動作(チェックボックス)を設定し、オプションです。テーブル要素に行きます。

4

mdl-data-table__cell—​non-numeric

テキストの書式設定をデータセルに設定します(オプション)。テーブルヘッダーとテーブルデータセルの両方に適用されます。

5

(none)

デフォルトでは、数値フォーマットをヘッダーまたはデータセルに設定します。

次の例は、 mdl-data-table クラスを使用してデータテーブルを表示する方法を理解するのに役立ちます。

mdl_data_tables

<html>
   <head>
      <script
         src = "https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js">
      </script>
      <link rel = "stylesheet"
         href = "https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css">
      <link rel = "stylesheet"
         href = "https://fonts.googleapis.com/icon?family=Material+Icons">
   </head>

   <body>
      <table class = "mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
         <thead>
            <tr><th class = "mdl-data-table__cell--non-numeric">Student</th>
               <th>Class</th><th>Grade</th></tr>
         </thead>

         <tbody>
            <tr><td class = "mdl-data-table__cell--non-numeric">Mahesh Parashar</td>
               <td>VI</td><td>A</td></tr>
            <tr><td class = "mdl-data-table__cell--non-numeric">Rahul Sharma</td>
               <td>VI</td><td>B</td></tr>
            <tr><td class = "mdl-data-table__cell--non-numeric">Mohan Sood</td>
               <td>VI</td><td>A</td></tr>
         </tbody>
      </table>

   </body>
</html>

結果

結果を確認します。