表格Table

表格 Table - 图1

  1. <table class="table">
  2. <thead>
  3. <tr>
  4. <th>Order</th>
  5. <th>Order Date</th>
  6. <th>Price</th>
  7. <th>Username</th>
  8. </tr>
  9. </thead>
  10. <tbody>
  11. <tr>
  12. <td>A012016032402</td>
  13. <td>2016/3/24</td>
  14. <td>$338.39</td>
  15. <td>Aaron</td>
  16. </tr>
  17. <tr>
  18. <td>A012016032402</td>
  19. <td>2016/3/24</td>
  20. <td>$338.39</td>
  21. <td>Cary</td>
  22. </tr>
  23. <tr>
  24. <td>A012016032402</td>
  25. <td>2016/3/24</td>
  26. <td>$338.39</td>
  27. <td>Evan</td>
  28. </tr>
  29. </tbody>
  30. </table>

响应式隐藏Responsive Hide

通过隐藏样式自由设定列隐藏

表格 Table - 图2

  1. <table class="table">
  2. <thead>
  3. <tr>
  4. <th>Order</th>
  5. <th class="hide-s">Order Date</th>
  6. <th class="hide-s">Price</th>
  7. <th>Username</th>
  8. </tr>
  9. </thead>
  10. <tbody>
  11. <tr>
  12. <td>A012016032402</td>
  13. <td class="hide-s">2016/3/24</td>
  14. <td class="hide-s">$338.39</td>
  15. <td>Aaron</td>
  16. </tr>
  17. <tr>
  18. <td>A012016032402</td>
  19. <td class="hide-s">2016/3/24</td>
  20. <td class="hide-s">$338.39</td>
  21. <td>Cary</td>
  22. </tr>
  23. <tr>
  24. <td>A012016032402</td>
  25. <td class="hide-s">2016/3/24</td>
  26. <td class="hide-s">$338.39</td>
  27. <td>Evan</td>
  28. </tr>
  29. </tbody>
  30. </table>

响应式滚动Responsive Scroll

添加父级元素<div class="table-scroll">,表格根据内容是否溢出自动隐藏并显示滚动条

表格 Table - 图3

  1. <div class="table-scroll">
  2. <table class="table">
  3. <thead>
  4. <tr>
  5. <th>Order</th>
  6. <th>Order Date</th>
  7. <th>Product Information</th>
  8. <th>Price</th>
  9. <th>Username</th>
  10. </tr>
  11. </thead>
  12. <tbody>
  13. <tr>
  14. <td>A012016032402</td>
  15. <td>2016/3/24</td>
  16. <td>This Dad Does Diapers, Cool Fathers Day New Dad Men's V-Neck T-Shirt,Color:Black,Size:S,Qty:1</td>
  17. <td>$338.39</td>
  18. <td>Aaron</td>
  19. </tr>
  20. <tr>
  21. <td>A012016032402</td>
  22. <td>2016/3/24</td>
  23. <td>This Dad Does Diapers, Cool Fathers Day New Dad Men's V-Neck T-Shirt,Color:Black,Size:S,Qty:1</td>
  24. <td>$338.39</td>
  25. <td>Cary</td>
  26. </tr>
  27. <tr>
  28. <td>A012016032402</td>
  29. <td>2016/3/24</td>
  30. <td>This Dad Does Diapers, Cool Fathers Day New Dad Men's V-Neck T-Shirt,Color:Black,Size:S,Qty:1</td>
  31. <td>$338.39</td>
  32. <td>Evan</td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>

添加class="nowrap",表格内容将不会进行换行

表格 Table - 图4

  1. <div class="table-scroll nowrap">
  2. <table class="table">
  3. ...
  4. </table>
  5. </div>

合并Merge

表格 Table - 图5

  1. <table class="table border">
  2. <thead>
  3. <tr>
  4. <th>Order</th>
  5. <th>Order Date</th>
  6. <th>Price</th>
  7. <th>Username</th>
  8. </tr>
  9. </thead>
  10. <tbody>
  11. <tr>
  12. <td rowspan="2">A012016032402</td>
  13. <td>2016/3/24</td>
  14. <td>$338.39</td>
  15. <td>Aaron</td>
  16. </tr>
  17. <tr>
  18. <td>2016/3/24</td>
  19. <td>$338.39</td>
  20. <td>Cary</td>
  21. </tr>
  22. <tr>
  23. <td>A012016032402</td>
  24. <td>2016/3/24</td>
  25. <td>$338.39</td>
  26. <td>Justin</td>
  27. </tr>
  28. <tr>
  29. <td colspan="2">A012016032402</td>
  30. <td>$338.39</td>
  31. <td>Lorin</td>
  32. </tr>
  33. </tbody>
  34. </table>

边框Border

添加class="border"增加边框效果

表格 Table - 图6

  1. <table class="table border">
  2. ...
  3. </table>

无边框Not border

添加class="notborder"去除边框效果

表格 Table - 图7

  1. <table class="table notborder">
  2. ...
  3. </table>

条纹Striped

添加class="striped"增加条纹式背景

表格 Table - 图8

  1. <table class="table striped">
  2. ...
  3. </table>

滑动Hover

添加class="hover"增加滑鼠背景色效果

表格 Table - 图9

  1. <table class="table hover">
  2. ...
  3. </table>

自定义风格Custom Style

可以使用自定义风格工具快速创建CSS

表格 Table - 图10

  1. <table class="table hover mystyle">
  2. ...
  3. </table>