Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/463.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Django视图组件没有';t对齐?_Javascript_Html_Css_Django_Twitter Bootstrap - Fatal编程技术网

Javascript Django视图组件没有';t对齐?

Javascript Django视图组件没有';t对齐?,javascript,html,css,django,twitter-bootstrap,Javascript,Html,Css,Django,Twitter Bootstrap,我是Django程序员的新手。我创建了简单的视图类,并将引导数据表放入其中。根据下面的链接,我添加了按钮以不同的格式保存数据表。 现在我的观点是这样的。 但我希望这样的观点。(免费测试搜索对齐是不正确的)。我最喜欢在表格底部添加按钮集。最低要求创建如下视图 我试了好几个小时,但还是没有成功。期待一些专家的帮助 ------------key\u list\u form.html----------------------------------------- {% extends "base

我是Django程序员的新手。我创建了简单的视图类,并将引导数据表放入其中。根据下面的链接,我添加了按钮以不同的格式保存数据表。 现在我的观点是这样的。

但我希望这样的观点。(免费测试搜索对齐是不正确的)。我最喜欢在表格底部添加按钮集。最低要求创建如下视图

我试了好几个小时,但还是没有成功。期待一些专家的帮助

------------key\u list\u form.html-----------------------------------------

{% extends "base.html" %}

{% block title %}Key List{% endblock %}

{% block heading %}
    <h2>Serial Keys</h2>
{% endblock %}

{% block content %}
    <table id="example" class="table table-bordered table-striped" cellspacing="0" width="100%">
        <col width='100'>
        <col width='100'>
        <thead>
            <tr>
                <th>Product Code</th>
                <th>Serial Key</th>
            </tr>
        </thead>

        <tbody>
            {% for x in key %}
                <tr>
                    <td>{{ x.b_p_code  }}</td>
                    <td>{{ x.key }}</td>
                </tr>
            {% endfor %}
        </tbody>

        <tfoot>
            <tr>
                <th>Product Code</th>
                <th>Serial Key</th>
            </tr>
        </tfoot>
    </table>

{% endblock %}
{% load staticfiles %}

<!doctype html>

<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Key Code - {% block title %}{% endblock %}</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="apple-touch-icon" href="{% static "apple-touch-icon.png" %}">
        <link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}">
        <style>
            body {
                padding-top: 50px;
                padding-bottom: 20px;
            }
        </style>
        <link rel="stylesheet" href="{% static "css/bootstrap-theme.min.css" %}">
        <link rel="stylesheet" href="{% static "css/main.css" %}">

        <!-- DataTables -->
        <link rel="stylesheet" href="https://cdn.datatables.net/1.10.10/css/dataTables.bootstrap.min.css">
        <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
        <link rel="stylesheet" href="{% static "plugins/datatables/extensions/TableTools/css/dataTables.tableTools.css" %}">
        <link rel="stylesheet" href="{% static "plugins/datatables/extensions/TableTools/css/style.css" %}">
    </head>

    <body>
        <div class="container">
            <header>
                {% block toggle_login %}
                    {% include "toggle_login.html" %}
                {% endblock %}
            </header>
            <div>
                {% block heading %}{% endblock %}
            </div>
            <div>
                {% block content %}{% endblock %}
            </div>

            <hr>


        </div>

        <script src="{% static "js/vendor/modernizr-2.8.3-respond-1.4.2.min.js" %}"></script>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="{% static "js/vendor/jquery-1.11.2.min.js" %}"><\/script>')</script>
        <script src="{% static "js/vendor/bootstrap.min.js" %}"></script>
        <script src="{% static "js/main.js" %}"></script>
        <script src="https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js"></script>
        <script src="https://cdn.datatables.net/1.10.10/js/dataTables.bootstrap.min.js" ></script>
        <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
        <script src="{% static "plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js" %}"></script>

        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
        <script>
            (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
            function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
            e=o.createElement(i);r=o.getElementsByTagName(i)[0];
            e.src='//www.google-analytics.com/analytics.js';
            r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
            ga('create','UA-XXXXX-X','auto');ga('send','pageview');
        </script>

        <script>
            $(function() {
                $( "#datepicker" ).datepicker();
            });
        </script>

        <script>
            $(document).ready( function () {
                $('#example').dataTable( {
                    "dom": 'T<"clear">lfrtip',
                    "tableTools": {
                        "sSwfPath": "{% static "plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf" %}"
                    }
                });
            });
        </script>
    </body>
</html>
{%extends“base.html”%}
{%block title%}键列表{%endblock%}
{%block heading%}
串行密钥
{%endblock%}
{%block content%}
产品代码
串行密钥
{键%%中的x为%0}
{x.b_p_代码}
{{x.key}}
{%endfor%}
产品代码
串行密钥
{%endblock%}
-----------base.html------------------------------

{% extends "base.html" %}

{% block title %}Key List{% endblock %}

{% block heading %}
    <h2>Serial Keys</h2>
{% endblock %}

{% block content %}
    <table id="example" class="table table-bordered table-striped" cellspacing="0" width="100%">
        <col width='100'>
        <col width='100'>
        <thead>
            <tr>
                <th>Product Code</th>
                <th>Serial Key</th>
            </tr>
        </thead>

        <tbody>
            {% for x in key %}
                <tr>
                    <td>{{ x.b_p_code  }}</td>
                    <td>{{ x.key }}</td>
                </tr>
            {% endfor %}
        </tbody>

        <tfoot>
            <tr>
                <th>Product Code</th>
                <th>Serial Key</th>
            </tr>
        </tfoot>
    </table>

{% endblock %}
{% load staticfiles %}

<!doctype html>

<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Key Code - {% block title %}{% endblock %}</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="apple-touch-icon" href="{% static "apple-touch-icon.png" %}">
        <link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}">
        <style>
            body {
                padding-top: 50px;
                padding-bottom: 20px;
            }
        </style>
        <link rel="stylesheet" href="{% static "css/bootstrap-theme.min.css" %}">
        <link rel="stylesheet" href="{% static "css/main.css" %}">

        <!-- DataTables -->
        <link rel="stylesheet" href="https://cdn.datatables.net/1.10.10/css/dataTables.bootstrap.min.css">
        <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
        <link rel="stylesheet" href="{% static "plugins/datatables/extensions/TableTools/css/dataTables.tableTools.css" %}">
        <link rel="stylesheet" href="{% static "plugins/datatables/extensions/TableTools/css/style.css" %}">
    </head>

    <body>
        <div class="container">
            <header>
                {% block toggle_login %}
                    {% include "toggle_login.html" %}
                {% endblock %}
            </header>
            <div>
                {% block heading %}{% endblock %}
            </div>
            <div>
                {% block content %}{% endblock %}
            </div>

            <hr>


        </div>

        <script src="{% static "js/vendor/modernizr-2.8.3-respond-1.4.2.min.js" %}"></script>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="{% static "js/vendor/jquery-1.11.2.min.js" %}"><\/script>')</script>
        <script src="{% static "js/vendor/bootstrap.min.js" %}"></script>
        <script src="{% static "js/main.js" %}"></script>
        <script src="https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js"></script>
        <script src="https://cdn.datatables.net/1.10.10/js/dataTables.bootstrap.min.js" ></script>
        <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
        <script src="{% static "plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js" %}"></script>

        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
        <script>
            (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
            function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
            e=o.createElement(i);r=o.getElementsByTagName(i)[0];
            e.src='//www.google-analytics.com/analytics.js';
            r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
            ga('create','UA-XXXXX-X','auto');ga('send','pageview');
        </script>

        <script>
            $(function() {
                $( "#datepicker" ).datepicker();
            });
        </script>

        <script>
            $(document).ready( function () {
                $('#example').dataTable( {
                    "dom": 'T<"clear">lfrtip',
                    "tableTools": {
                        "sSwfPath": "{% static "plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf" %}"
                    }
                });
            });
        </script>
    </body>
</html>
{%load staticfiles%}
键代码-{%block title%}{%endblock%}
身体{
填充顶部:50px;
垫底:20px;
}
{%block toggle_login%}
{%include“toggle_login.html”%}
{%endblock%}
{%block heading%}{%endblock%}
{%block content%}{%endblock%}

window.jQuery | | document.write(“”) (函数(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]| |(b[l]= 函数(){(b[l].q=b[l].q | |[]).push(参数)});b[l].l=+新日期; e=o.createElement(i);r=o.getElementsByTagName(i)[0]; e、 src='//www.google-analytics.com/analytics.js'; r、 parentNode.insertBefore(e,r)}(窗口,文档,'script','ga'); ga(“创建”、“UA-XXXXX-X”、“自动”);ga('send','pageview'); $(函数(){ $(“#日期选择器”).datepicker(); }); $(文档).ready(函数(){ $('#示例')。数据表({ “dom”:“Tlfrtip”, “表格工具”:{ “sSwfPath”:“{%static”插件/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf”%}” } }); });
请提供一些专家帮助。

替换

<table id="example" class="table table-bordered table-striped" cellspacing="0" width="100%">



您错过了引导数据表类。

从屏幕截图来看,似乎缺少一些静态文件,屏幕截图不足以进行调试,请检查控制台是否有404关于任何资源。如果是,请尝试
python manage.py
。同时检查静态文件是否可以在
url.py
@AnkitPopli中访问不,先生,我检查,没有404错误。我将引导数据表添加到此。但是什么也没发生。你能不能也添加
表单内联
类,看看这是否有效。贝赫尔,是的,我可以添加,请问,我是如何找到那个类的?我没上过这样的课?