twitter-bootstrap Bootsrap“斑马条纹”表类不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20825053/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 19:35:47  来源:igfitidea点击:

Bootsrap "zebra-striped" table class doesn't work

twitter-bootstrap

提问by drake035

Just downloaded Bootstrap from getboostrap.com (direct link), then correctly included bootstrap.min.css, bootstrap-theme.min.css and bootstrap.min.js into my document.

刚刚从 getboostrap.com(直接链接)下载了 Bootstrap ,然后将 bootstrap.min.css、bootstrap-theme.min.css 和 bootstrap.min.js 正确包含到我的文档中。

I styled my forms successfully, now I want to add the "zebra-striped" class to my tables. But nothing happens, the TR and TD elements in the table don't get the class applied to them. I searched "zebra-striped" in the 3 files (2 CSS and 1 JS), it's not there.

我成功地设计了我的表单,现在我想将“斑马条纹”类添加到我的表格中。但是什么也没有发生,表中的 TR 和 TD 元素没有得到应用到它们的类。我在 3 个文件(2 个 CSS 和 1 个 JS)中搜索了“斑马条纹”,它不存在。

Version problem? Or should I install some Bootstrap add-on?

版本问题?或者我应该安装一些 Bootstrap 插件吗?

回答by Florin

Hello this is the right class for table stripped

你好,这是剥离表的正确类

<table class="table table-striped">
  ...
</table>

回答by SNEH PANDYA

<!DOCTYPE html>   
<html lang="en">   
<head>   
<meta charset="utf-8">   
<title>Example of Zebra Table with twitter bootstrap</title>   
<meta name="description" content="Creating a Zebra table with Twitter           Bootstrap. Learn with example of a Zebra Table with Twitter Bootstrap.">  
<link href="/twitter-bootstrap/twitter-bootstrap-  v2/docs/assets/css/bootstrap.css" rel="stylesheet">   
</head>  
<body>  
<table class="table table-striped">  
    <thead>  
      <tr>  
        <th>Student-ID</th>  
        <th>First Name</th>  
        <th>Last Name</th>  
        <th>Grade</th>  
      </tr>  
    </thead>  
    <tbody>  
      <tr>  
        <td>001</td>  
        <td>Rammohan </td>  
        <td>Reddy</td>  
        <td>A+</td>  
      </tr>  
      <tr>  
        <td>002</td>  
        <td>Smita</td>  
        <td>Pallod</td>  
        <td>A</td>  
      </tr>  
      <tr>  
        <td>003</td>  
        <td>Rabindranath</td>  
        <td>Sen</td>  
        <td>A+</td>  
      </tr>  
    </tbody>  
  </table>  


- See more at: http://www.w3resource.com/twitter-bootstrap/tables-tutorial.php#sthash.NQn0cWnr.dpuf


- 查看更多信息:http: //www.w3resource.com/twitter-bootstrap/tables-tutorial.php#sthash.NQn0cWnr.dpuf

回答by Talha Awan

In case it's helpful for somebody, the stripes were not showing for me because of conflict between styles of bootstrap and angular material design. So if you're doing everything right, look for a possible style conflict.

如果它对某人有帮助,由于引导程序样式和有角度的材料设计之间的冲突,条纹没有显示给我。因此,如果您做的一切都正确,请寻找可能的风格冲突。