为什么我的网站页脚显示在我的桌子上方?

时间:2016-02-19 21:45:36

标签: html css

我的所有容器都已关闭,似乎位于正确的位置。我无法弄清楚为什么会这样。我将发布代码作为图片的伴侣。当我将表关闭在当前位置上方的任何位置时,表数据不会在表本身中发布。

This is the issue I am currently experiencing

       <style>.container{width:1300px;}</style>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/south-street/jquery-ui.css" rel="stylesheet">
    <link href="<?php echo plugins_url(); ?>/booking/css/jquery.signature.css" rel="stylesheet">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script>
    <script src="<?php echo plugins_url(); ?>/booking/js/jquery.signature.js"></script>
    <script src='https://javascriptbase64.googlecode.com/files/base64.js' type='text/javascript'></script>
    <table class="table table-bordered">
        <div class="outer">
            <div class="inner">
        <thead>
            <tr>
                <th style="font-weight:15px !important;">Driver Name</th>
                <th style="font-weight:15px !important;">Driver Number</th>
                <th style="font-weight:15px !important;">Pay</th>
                <th style="font-weight:15px !important;">Start From</th>
                <th style="font-weight:15px !important;">Destination</th>
                <th style="font-weight:15px !important;width:14%;">Date</th>
                <th style="font-weight:15px !important;width:14%;">Status</th>
                <th style="font-weight:15px !important;width:14%;">Review</th>
                <th style="font-weight:15px !important;width:14%;">Notes</th>
            </tr>
        </thead>
        <tbody>
            <?php 
                while($row=mysqli_fetch_object($result)){ 

                    $customerq = 'SELECT * from driverinformation join wp_users on wp_users.ID=driverinformation.userid WHERE driverinformation.ID='.$row->driver;
                    $userresults = mysqli_query($conn, $customerq);
                    $users = mysqli_fetch_object($userresults);

            ?>
            <tr>
                <td><?php echo $users->display_name; ?><a style="text-decoration:none;color:white;" href="<?php echo site_url(); ?>/my-reviews?id=<?php echo $users->userid; ?>" class="btn btn-xs btn-success">Reviews</a></td>
                <td><?php echo $users->phone; ?></td>
                <td><?php echo "$".$row->jobpay; ?></td>
                <td><?php echo $row->source; ?></td>
                <td><?php echo $row->destination; ?></td>
                <td><?php echo date($row->bookeddate); ?></td>
                <td>
                    <?php if($row->status == 1){ ?>
                        <p style="color:green;font-weight:bold;">Completed</p>
                    <?php }else if($row->status == 2){ ?>
                        <p style="color:red;font-weight:bold;">Incomplete</p>
                    <?php }else{ ?>
                        <p style="color:blue;font-weight:bold;">Yet to start</p>
                    <?php } ?>

                </td>
                <td><a href="<?php echo site_url(); ?>/add-review?id=<?php echo $users->userid; ?>" style="text-decoration:none;color:white;" class="btn btn-xs btn-primary">POST</a></td>

            <td><?php if($row->signature == 1){ ?>
                        <textarea style="display:none;" id="signim<?php echo $row->bookingid; ?>"><?php echo $row->signimage; ?></textarea>
                        <div id="sig<?php echo $row->bookingid; ?>" style="width:300px;height:150px;float:left;"></div>
                                                <?php } 
                     else { 
                    echo "Not Yet Signed";
                    } ?>    

            </td>
            </tr>

                <?php if($row->signature == 1){ ?>
                    <script>
                        $(function() {
                            var jsonval = $("#signim<?php echo $row->bookingid; ?>").val();
                            $('#sig'+"<?php echo $row->bookingid; ?>").signature({"disabled":true});
                            $('#sig'+"<?php echo $row->bookingid; ?>").signature('draw', jsonval);

                        });
                    </script>
                <?php } ?>

<?php } } }

add_shortcode("addreview", "add_review");

function add_review()
{
    $conn = dbconnection();
    if($_POST){

        $driver = $_POST["driver"];
        $user = $_POST["user"];
        $rating = $_POST["rating"];
        $comment = $_POST["comment"];

        $query = 'INSERT INTO reviews(driver,user,rate,comment,reviewdate) VALUES("'.$driver.'", "'.$user.'", "'.$rating.'", "'.$comment.'", "'.time().'")';
        $insert = mysqli_query($conn, $query);


        ?>
        <script>
            window.location.href="<?php echo site_url(); ?>/review-submission-success?success=1";
        </script>


    <?php }

    if(isset($_GET["id"])){

        $driverid = $_GET["id"];
        $conn = dbconnection();
        $userid = get_current_user_id();

   ?>

        <form id="driver_form" class="driver_form" action="" method="POST">
            <div class="col-md-12">
                <div class="col-md-10" style="margin-top:12px;">
                    <div class="form-group">
                        <label for="input-Default" class="col-md-4 control-label" style="text-align:right;">Rating<span style="color:red;">*</span> :</label>
                        <div class="col-md-8">
                            <select name="rating" class="form-control" required>
                                <option value="">Select Rating</option>
                                <option value="1">1 Star</option>
                                <option value="2">2 Star</option>
                                <option value="3">3 Star</option>
                                <option value="4">4 Star</option>
                                <option value="5">5 Star</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-md-10" style="margin-top:12px;">    
                    <div class="form-group" style="margin-top:15px;">
                        <label for="input-Default" class="col-md-4 control-label" style="text-align:right;">Comment<span style="color:red;">*</span> :</label>
                        <div class="col-md-8">
                            <textarea name="comment" class="form-control" required style="height:150px;"></textarea>
                        </div>
                    </div>

                </div>
            </div>

            <div class="col-md-10" style="margin-top:12px;">
                <div class="col-md-5" style="margin-left:25%;">
                    <input type="hidden" name="driver" value="<?php echo $driverid; ?>"  />
                    <input type="hidden" name="user" value="<?php echo $userid; ?>"  />
                    <input type="submit" value="<?php _e('Add Review'); ?>"/>
                </div>
            </div>
        </form>

    </tbody>
            </table>

1 个答案:

答案 0 :(得分:2)

问题可能源于table元素不能有div个孩子的事实:

<table class="table table-bordered">
    <div class="outer">
        <div class="inner">
            <thead>
                <tr></tr>
            </thead>
        </div>
    </div>
</table>

将被纠正&#34;到:

<div class="outer">
   <div class="inner">
   </div>
</div>
<table class="table table-bordered">
    <thead>
        <tr></tr>
    </thead>
</table>

您可能希望将其更改为:

<div class="outer">
    <div class="inner">
        <table class="table table-bordered">
            <thead>
                <tr></tr>
            </thead>
        </table>
    </div>
</div>

从那里开始。