2017-06-16 45 views
0

我想在我的ReactJs-Spring項目中包含react-bootstrap主題。在ReactJs中使用Bootstrap/React Bootstrap時無法使用表類名

我已鏈接基於在其網站上的教程資源顯示如下:

<script src="https://unpkg.com/[email protected]/dist/react.js"></script> 
<script src="https://unpkg.com/[email protected]/dist/react-dom.js"></script> 
<script src="https://unpkg.com/[email protected]/babel.min.js</script> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap/0.31.0/react-bootstrap.min.js"></script> 
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> 

我像這樣的代碼表元素:

<table className="table table-striped">       
    <tr> 
    <th>Name</th> 
    <th>Age</th> 
    <th>Years</th> 
    <th>Delete</th> 
    </tr>       
</table> 

但在網站上,它不沒有任何變化: table

任何人都可以幫我解決這個問題嗎?由於

回答

0

嘗試增加theadtbody元素,如:

<table className="table table-striped"> 
    <thead>    
    <tr> 
     <th>Name</th> 
     <th>Age</th> 
     <th>Years</th> 
     <th>Delete</th> 
    </tr>  
    </thead> 
    <tbody> 
    ... 
    </tbody>      
</table>