codecamp

Material Design Lite 数据表

该MDL提供多种CSS类各种预先定义的外观和行为增强功能适用于显示器表作为数据表。下表中提到的可用类和它们的影响。

SN 类名称和说明
1 MDL-数据表
标识表作为MDL组件,所需的表元素。
2 MDL-JS-数据表
设置基本MDL行为表并需要表元素。
3 MDL-数据表-可选
将所有/单个可选行为(复选框)和可选;那张表元素。
4 MDL-数据table__cell -非数字
设置文本格式数据的单元格,是可选的;接着两个表头和表数据单元。
(没有)
默认情况下,设置了数字格式,以头或数据的单元格。

以下例子展示了利用MDL-数据表的类来显示的数据表。

mdl_data_tables.htm

<html>
<head>
   <script src="https://atts.w3cschool.cn/attachments/tuploads/materialdesignlite/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>

结果

验证结果。


Material Design Lite 交换机
Material Design Lite 文本框
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Material Design Lite Useful Resources

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }