首页 Bootstrap5组件手册

表格


<table>
表格类: 
.table             基础表格(必须) 
     
组合类:
.table-striped     条纹样式  
.table-bordered    带边框样式 
.table-dark        黑色背景样式 
.table-borderless  无边框样式 
.table-hover       鼠标悬停状态样式

示例

基础表格:  
<table class="table">     
  <tr>          
    <th>列1</th>  
    <th>列2</th>
    <th>列3</th> 
  </tr>      
  <tr>     
    <td>列1内容</td>     
    <td>列2内容</td>    
    <td>列3内容</td>     
  </tr>  
  <tr>       
    <td>列1内容</td>     
    <td>列2内容</td>    
    <td>列3内容</td>    
  </tr> 
</table>






其它类组合表格:
<table class="table table-dark table-hover"> 
  <tr>   
    <th>列1</th>   
    <th>列2</th>   
    <th>列3</th>  
  </tr>         
  <tr>        
    <td>列1内容</td>   
    <td>列2内容</td>    
    <td>列3内容</td>    
  </tr>  
  <tr>          
    <td>列1内容</td> 
    <td>列2内容</td>  
    <td>列3内容</td>   
  </tr> 
 </table>