在表格顶部使用bootstrap粘性面板。想要调整表格和面板

时间:2015-05-27 14:48:00

标签: twitter-bootstrap sticky scrollable

我在桌子顶部使用了引导粘性面板。想要调整表格和面板的列宽。我不必使用面板。我只是将它用于粘性功能。我希望该面板是可以使用表格列宽调整的列标题。如何调整列宽和面板宽度,使它们相同。目前每个占据表的25%。我希望第一个列/面板标题占用5%,然后第二个列面板占用10%。换句话说,可定制的列/面板宽度。我尝试将我的代码加载到bootply但它不会运行。我为此道歉。

**编辑:我刚刚意识到粘性功能不起作用。我以前工作过。我正在努力搞清楚。

<!DOCTYPE html>
<html lang="en">

<head>
    <title>Clinical Molecular Incident Reporting System</title>
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1">


    <!-- Bootstrap MaxCDN -->
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <!-- jQuery library -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Latest compiled JavaScript -->
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <!--my styling-->
    <link rel="stylesheet" type="text/css" href="/static/error_tracking/css/master.css">
</head>

<body>
    <div class="container-fluid"> <!-- bs replaced id="content"-->
        <div id="pagetop">
            <h1><b>Clinical Molecular Incident Reporting System</b></h1>
            <span id="navigation">

                <a href="/search_incidents/">search incidents</a> | 
                <a href="/report_incident/">report incident</a> | 
                <a href="/resolve_incident/">resolve incident</a> |
                <a href="/equipment_search/">resolve incident</a>
                <span id="user-info">jdilts | <a href="/logout/">logout</a></span>  

            </span>
        </div>

<br>
<p>Not only have you successfully logged in, you have also made it to the Search Incidents page using html templates</p>
<br><br>


<div id="table-wrapper" style="overflow:auto; height:600px;">
    <table class="table table-striped header-fixed">
        <!--<col width="5%" />-->
        <!--<col width="12%" />-->
        <!--<col width="5%" />-->
        <!--<col width="83%" />-->
        <thead>
            <tr><th>ID</th><th>Created At</th><th>Category</th><th>Description</th></tr>
        </thead>

        <tbody>
            <tr><td>12</td><td>Sept. 4, 2012, 10 p.m.</td><td>4</td>
        <td class="left">But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?</td></tr>
        </tbody>

        <tbody>
            <tr><td>1</td><td>Sept. 3, 2012, 10 p.m.</td><td>1</td>
        <td class="left">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</td></tr>
        </tbody>

        <tbody>
            <tr><td>2</td><td>Sept. 3, 2012, 10 p.m.</td><td>1</td>
        <td class="left">But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?</td></tr>
        </tbody>

        <tbody>
            <tr><td>3</td><td>Sept. 3, 2012, 10 p.m.</td><td>1</td>
        <td class="left">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</td></tr>
        </tbody>

        <tbody>
            <tr><td>4</td><td>Sept. 3, 2012, 10 p.m.</td><td>2</td>
        <td class="left">On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.</td></tr>
        </tbody>

        <tbody>
            <tr><td>5</td><td>Sept. 3, 2012, 10 p.m.</td><td>2</td>
        <td class="left">On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.</td></tr>
        </tbody>

        <tbody>
            <tr><td>6</td><td>Sept. 3, 2012, 10 p.m.</td><td>2</td>
        <td class="left">blah</td></tr>
        </tbody>

        <tbody>
            <tr><td>7</td><td>Sept. 3, 2012, 10 p.m.</td><td>2</td>
        <td class="left">blah</td></tr>
        </tbody>

        <tbody>
            <tr><td>8</td><td>Sept. 3, 2012, 10 p.m.</td><td>3</td>
        <td class="left">blah</td></tr>
        </tbody>

        <tbody>
            <tr><td>9</td><td>Sept. 3, 2012, 10 p.m.</td><td>3</td>
        <td class="left">blah</td></tr>
        </tbody>

        <tbody>
            <tr><td>10</td><td>Sept. 3, 2012, 10 p.m.</td><td>3</td>
        <td class="left">blah</td></tr>
        </tbody>

        <tbody>
            <tr><td>11</td><td>Sept. 3, 2012, 10 p.m.</td><td>4</td>
        <td class="left">blah</td></tr>
        </tbody>

        <tbody>
            <tr><td>13</td><td>Sept. 3, 2012, 10 p.m.</td><td>4</td>
        <td class="left">blah</td></tr>
        </tbody>

    </table>
</div>

    </div> <!-- bs -->
</body>
</html>

/*--------------------------------------------------------------BASE.HTML*/
#pagetop {
    background-color: #04B4AE; 
    font-family: Verdana; 
    box-sizing: border-box;
    ms-box-sizing: border-box;
    webkit-box-sizing: border-box;
    moz-box-sizing: border-box;
    padding: 8px;
}

#pagetop  a:link {color:#000; text-decoration: none;}  /* unvisited link  */
#pagetop  a:visited {color:#000; text-decoration: none;}  /* visited link    */
#pagetop  a:hover {color:#000; text-decoration: underline;}  /* mouse over link */
#pagetop  a:active {color:#000; text-decoration: none;}  /* selected link   */ 

#navigation{padding-left: 5px;}

#user-info {float: right;}


/*--------------------------------------------------------------SEARCH_INCIDENTS.HTML*/
.header-fixed {
    width: 100% 
}

.header-fixed > tbody > tr:after,
.header-fixed > thead > tr:after {
    content: ' ';
    display: block;
    visibility: hidden;
    clear: both;
}

.header-fixed > tbody > tr > td,
.header-fixed > thead > tr > th {
    width: 25%;
    float: left;
}

0 个答案:

没有答案