<!DOCTYPE html> <html lang="en"> <head> <title>Job</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <body> <div class="container"> <h1>Basic Table Example</h1> <table class="table"> <tr><th>Id</th><th>Name</th><th>Age</th></tr> <tr><td>101</td><td>Rahul</td><td>23</td></tr> <tr><td>102</td><td>Umesh</td><td>22</td></tr> <tr><td>103</td><td>Max</td><td>29</td></tr> <tr><td>104</td><td>Ajeet</td><td>21</td></tr> </table> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Job</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <body> <div class="container"> <h1>Striped Table Example</h1> <table class="table table-striped"> <tr><th>Id</th><th>Name</th><th>Age</th></tr> <tr><td>101</td><td>Rahul</td><td>23</td></tr> <tr><td>102</td><td>Umesh</td><td>22</td></tr> <tr><td>103</td><td>Max</td><td>29</td></tr> <tr><td>104</td><td>Ajeet</td><td>21</td></tr> </table> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Job</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <body> <div class="container"> <h1>Bordered Table Example</h1> <table class="table table-striped table-bordered"> <tr><th>Id</th><th>Name</th><th>Age</th></tr> <tr><td>101</td><td>Rahul</td><td>23</td></tr> <tr><td>102</td><td>Umesh</td><td>22</td></tr> <tr><td>103</td><td>Max</td><td>29</td></tr> <tr><td>104</td><td>Ajeet</td><td>21</td></tr> </table> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Job</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <body> <div class="container"> <h1>Hower rows Table Example</h1> <table class="table table-hover"> <tr><th>Id</th><th>Name</th><th>Age</th></tr> <tr><td>101</td><td>Rahul</td><td>23</td></tr> <tr><td>102</td><td>Umesh</td><td>22</td></tr> <tr><td>103</td><td>Max</td><td>29</td></tr> <tr><td>104</td><td>Ajeet</td><td>21</td></tr> </table> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Job</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <body> <div class="container"> <h1>Condensed Table Example</h1> <table class="table table-condensed"> <tr><th>Id</th><th>Name</th><th>Age</th></tr> <tr><td>101</td><td>Rahul</td><td>23</td></tr> <tr><td>102</td><td>Umesh</td><td>22</td></tr> <tr><td>103</td><td>Max</td><td>29</td></tr> <tr><td>104</td><td>Ajeet</td><td>21</td></tr> </table> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
Class | 说明 |
.active | 用于将悬停颜色应用于表格行或表格单元格 |
.success | 它表示成功或积极的行动 |
.info | 它表示中立的信息变化或行动 |
.warning | 它指定了可能需要注意的警告 |
.danger | 它表示危险或潜在的负面行动 |
<!DOCTYPE html> <html lang="en"> <head> <title>Job</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <body> <div class="container"> <h1>Contextual classes</h1> <table class="table"> <tr class="success"><th>Id</th><th>Name</th><th>Age</th></tr> <tr class="active"><td>101</td><td>Rahul</td><td>23</td></tr> <tr class="danger"><td>102</td><td>Umesh</td><td>22</td></tr> <tr class="info"><td>103</td><td>Max</td><td>29</td></tr> <tr class="warning"><td>104</td><td>Ajeet</td><td>21</td></tr> </table> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Job</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <body> <div class="container"> <h1>Contextual classes</h1> <div class="table-responsive"> <table class="table"> <tr class="success"><th>Id</th><th>Name</th><th>Age</th></tr> <tr class="active"><td>101</td><td>Rahul</td><td>23</td></tr> <tr class="danger"><td>102</td><td>Umesh</td><td>22</td></tr> <tr class="info"><td>103</td><td>Max</td><td>29</td></tr> <tr class="warning"><td>104</td><td>Ajeet</td><td>21</td></tr> </table> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Black/Dark Table</h2> <p>The .table-dark class is used to add a black background to the table:</p> <table class="table table-dark"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>Ajeet</td> <td>Kumar</td> <td>ajeet@jtp.com</td> </tr> <tr> <td>Mahesh</td> <td>Sharma</td> <td>mahesh@jtp.com</td> </tr> <tr> <td>Sonoo</td> <td>Jaiswal</td> <td>sonoo@jtp.com</td> </tr> </tbody> </table> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Dark Striped Table</h2> <p>Combine the .table-dark class and .table-striped class to create a dark, striped table: </p> <table class="table table-dark table-striped"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>Ajeet</td> <td>Kumar</td> <td>ajeet@jtp.com</td> </tr> <tr> <td>Mahesh</td> <td>Sharma</td> <td>mahesh@jtp.com</td> </tr> <tr> <td>Sonoo</td> <td>Jaiswal</td> <td>sonoo@jtp.com</td> </tr> </tbody> </table> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Hoverable Dark Table</h2> <p>The .table-hover class is used to add a hover effect (grey background color) on table rows:</p> <table class="table table-dark table-hover"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>Ajeet</td> <td>Kumar</td> <td>ajeet@jtp.com</td> </tr> <tr> <td>Mahesh</td> <td>Sharma</td> <td>mahesh@jtp.com</td> </tr> <tr> <td>Sonoo</td> <td>Jaiswal</td> <td>sonoo@jtp.com</td> </tr> </tbody> </table> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Contextual Classes Example</h2> <table class="table"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>Default</td> <td>A</td> <td>a@jtp.com</td> </tr> <tr class="table-primary"> <td>Primary</td> <td>B</td> <td>b@jtp.com</td> </tr> <tr class="table-success"> <td>Success</td> <td>C</td> <td>c@jtp.com</td> </tr> <tr class="table-danger"> <td>Danger</td> <td>D</td> <td>d@jtp.com</td> </tr> <tr class="table-info"> <td>Info</td> <td>E</td> <td>e@jtp.com</td> </tr> <tr class="table-warning"> <td>Warning</td> <td>F</td> <td>f@jtp.com</td> </tr> <tr class="table-active"> <td>Active</td> <td>G</td> <td>g@jtp.com</td> </tr> <tr class="table-secondary"> <td>Secondary</td> <td>H</td> <td>h@jtp.com</td> </tr> <tr class="table-light"> <td>Light</td> <td>I</td> <td>j@jtp.com</td> </tr> <tr class="table-dark text-dark"> <td>Dark</td> <td>K</td> <td>k@jtp.com</td> </tr> </tbody> </table> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Table Head Colors</h2> <table class="table"> <thead class="thead-dark"> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>Ajeet</td> <td>Kumar</td> <td>ajeet@jtp.com</td> </tr> <tr> <td>Mahesh</td> <td>Sharma</td> <td>mahesh@jtp.com</td> </tr> <tr> <td>Sonoo</td> <td>Jaiswal</td> <td>sonoo@jtp.com</td> </tr> </tbody> </table> <table class="table"> <thead class="thead-light"> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>Ajeet</td> <td>Kumar</td> <td>ajeet@jtp.com</td> </tr> <tr> <td>Mahesh</td> <td>Sharma</td> <td>mahesh@jtp.com</td> </tr> <tr> <td>Sonoo</td> <td>Jaiswal</td> <td>sonoo@jtp.com</td> </tr> </tbody> </table> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Small Table Example</h2> <p>The .table-sm class is used to make the table smaller by cutting cell padding in half.</p> <table class="table table-bordered table-sm"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>Ajeet</td> <td>Kumar</td> <td>ajeet@jtp.com</td> </tr> <tr> <td>Mahesh</td> <td>Sharma</td> <td>mahesh@jtp.com</td> </tr> <tr> <td>Sonoo</td> <td>Jaiswal</td> <td>sonoo@jtp.com</td> </tr> </tbody> </table> </div> </body> </html>