Pure.CSS表

2018-12-23 09:48 更新

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


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号