html - 为什么我的网站页脚显示在我的表格上方?

标签 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>

最佳答案

问题可能源于 table 元素不能有 div 子元素:

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

将被“更正”为:

<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>

然后从那里继续。

关于html - 为什么我的网站页脚显示在我的表格上方?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35515651/

相关文章:

Python Regex - 在 html 标签之间查找字符串

css - href 将链接文本从正文中拉开

html - 在 DIV 内对齐 DIV 组居中

javascript - replace() 与第二个参数作为变量?

javascript - 如何使弹出div可拖动

html - 将 CSS 过滤器应用于 SVG 时出现 Firefox Bug?

javascript - 使用 HTML、Javascript 将数据保存在本地文件中?

javascript - 当鼠标悬停在 HTML 表格中的 TD 上时,有没有办法获取 TH 的值?

javascript - 如何将 <li> 附加到 <ul> 并同时使用 jquery 在 <li> 上设置 css

jquery - 有没有办法使用 jQuery 选择浏览器的滚动条?