2016年12月5日 星期一

boostrap table style



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <style>
        .row div {
            border: 1px solid #eee;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div class="container">
        <table class="table  
table-bordered  table-hover  table-striped">
            <thead class="
thead-inverse">
                <tr>
                    <th>#</th>
                    <th>First Name</th>
                    <th>Last Name</th>
                    <th>Username</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th>1</th>
                    <td>John</td>
                    <td>Smith</td>
                    <td>jsmith</td>
                </tr>
                <tr class='table-danger'>
                    <th>2</th>
                    <td>Jacob</td>
                    <td class="bg-info">Thornton</td>
                    <td>jacobs</td>
                </tr>
                <tr>
                    <th>3</th>
                    <td class="bg-primary">Laurence</td>
                    <td class="bg-success">Svekis</td>
                    <td class="bg-warning">lsvekis</td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
</html>
===================================================


ClassDescriptionExample
.tableAdds basic styling (light padding and only horizontal dividers) to any <table>Try it
.table-stripedAdds zebra-striping to any table row within <tbody> (not available in IE8)Try it
.table-borderedAdds border on all sides of the table and cellsTry it
.table-hoverEnables a hover state on table rows within a <tbody>Try it
.table-condensedMakes table more compact by cutting cell padding in half

<tr>, <th> and <td> Classes

Use the classes below to color table rows or cells:
ClassDescriptionExample
.activeApplies the hover color (light-grey) to a particular row or cellTry it
.successIndicates a successful or positive actionTry it
.infoIndicates a neutral informative change or actionTry it
.warningIndicates a warning that might need attentionTry it
.dangerIndicates a dangerous or potentially negative action

Responsive Tables

The .table-responsive class creates a responsive table. The table will then scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, there is no difference:










沒有留言:

張貼留言