codecamp

Pure.CSS表

PURE.CSS可以用来显示不同类型采用各种样式超过纯表的表。

S.N.类名称和描述
1  pure-table
代表具有任何默认的填充,边框和标题强调一个基本的表格。
2  pure-table-bordered
绘制跨行的边框表。
3  pure-table-horizontal
绘制带有水平线的表格。
4  pure-table-striped
显示一个精简表。
  pure-table-odd
如果应用于其他所有tr, 则更改行的背景并创建斑马风格的效果。

purecss_tables.htm

<html>
   <head>
      <title>The PURE.CSS Tables</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://yui.yahooapis.com/pure/0.6.0/pure-min.css">
   </head>
   <body> 
      <h2>Tables Demo</h2>
	  <hr/>
	  <h3>Simple Table</h3>
      <table class="pure-table">
         <thead>
            <tr><th>Student</th><th>Class</th><th>Grade</th></tr>
         </thead>
         <tbody>
            <tr><td>Mahesh Parashar</td><td>VI</td><td>A</td></tr>
            <tr><td>Rahul Sharma</td><td>VI</td><td>B</td></tr>
            <tr><td>Mohan Sood</td><td>VI</td><td>A</td></tr>
         </tbody>
      </table>
      <h3>Bordered Table</h3>
      <table class="pure-table pure-table-bordered">
         <thead>
            <tr><th>Student</th><th>Class</th><th>Grade</th></tr>
         </thead>
         <tbody>
            <tr><td>Mahesh Parashar</td><td>VI</td><td>A</td></tr>
            <tr><td>Rahul Sharma</td><td>VI</td><td>B</td></tr>
            <tr><td>Mohan Sood</td><td>VI</td><td>A</td></tr>
         </tbody>
      </table>     
	  <h3>Table with Horizontal Borders</h3>
      <table class="pure-table pure-table-horizontal">
         <thead>
            <tr><th>Student</th><th>Class</th><th>Grade</th></tr>
         </thead>
         <tbody>
            <tr><td>Mahesh Parashar</td><td>VI</td><td>A</td></tr>
            <tr><td>Rahul Sharma</td><td>VI</td><td>B</td></tr>
            <tr><td>Mohan Sood</td><td>VI</td><td>A</td></tr>
         </tbody>
      </table>     
	  <h3>Stripped Table</h3>
      <table class="pure-table pure-table-striped">
         <thead>
            <tr><th>Student</th><th>Class</th><th>Grade</th></tr>
         </thead>
         <tbody>
            <tr><td>Mahesh Parashar</td><td>VI</td><td>A</td></tr>
            <tr><td>Rahul Sharma</td><td>VI</td><td>B</td></tr>
            <tr><td>Mohan Sood</td><td>VI</td><td>A</td></tr>
         </tbody>
      </table>
   </body>
</html>

结果

验证结果。

Tables Demo


Simple Table

StudentClassGrade
Mahesh ParasharVIA
Rahul SharmaVIB
Mohan SoodVIA

Bordered Table

StudentClassGrade
Mahesh ParasharVIA
Rahul SharmaVIB
Mohan SoodVIA

Table with Horizontal Borders

StudentClassGrade
Mahesh ParasharVIA
Rahul SharmaVIB
Mohan SoodVIA

Stripped Table

StudentClassGrade
Mahesh ParasharVIA
Rahul SharmaVIB
Mohan SoodVIA


Pure.CSS按钮
Pure.CSS图片
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Pure.CSS 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; }