footer of django-tables2 table shrinks when bootstrap is linked

Alex K.

If I link bootstrap to my template, width of the table footer shrinks to the minimum size (occupies just as much space as needed to contain page number, 'Next' button, and total number of rows). When I delete the link everything is OK again but I need bootstrap for my form. How it looks (short footer after adding a link to bootstrap):

Snapshot for short footer after adding a link to bootstrap

There is the code of my templates:

base.html

{% load render_table from django_tables2 %}
{% load crispy_forms_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="static/django_tables2/themes/paleblue/css/screen.css" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <title></title>
</head>
<body>
    {% block my_table %}{% endblock %}
</body>
</html

object_list.html

{% extends "base.html" %}
{% load render_table from django_tables2 %}
{% load crispy_forms_tags %}

{% block my_table %}
    <div>
        <form action="" method="get">
            {% crispy filter.form filter.form.helper %}
        </form>
    </div>
    {% render_table table %}
{% endblock %}
Alex K.

Seems like all I needed was to add 'width: 100%;' to 'table.paleblue + ul.pagination' rule into django_tables2/themes/paleblue/css/screen.css file.

Edited css should be like this:

table.paleblue + ul.pagination {
    background: white url(../img/pagination-bg.gif) left 180% repeat-x;
    overflow: auto;
    margin: 0;
    padding: 10px;
    border: 1px solid #DDD;
    list-style: none;
    width: 100%;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Modify how a field displays on Django tables2 table

Exporting of Django tables2

In Django Tables2, how do you make a column show text from a table referenced by a foreign key?

Dynamic tables with Django tables2

iFrame Footer gets cut off when browser shrinks

Bootstrap 4 Text shrinks when collapsing

Getting Django Tables2 to work

Django Tables2 duplicated results

Django tables2 add custom column for another model

Add link on a web page to export tables2 data in Django

Maintaining header/footer position when using grid layout + bootstrap + table overflow

How to fix footer values in bootstrap table?

Table footer with linked margin note creating large break in text

Bootstrap footer going up when zoomed

Footer shrinks even if size is fixed + strange behaviour

Is it right that django migrations are running the filter of django tables2 module before running the migrations?

Table Pagination [Bootstrap - Django]

(Bootstrap) Is it possible to show menu item icons when the viewport shrinks rather than collapsing the menu altogether?

Bootstrap input field shrinks when set inline-block with another button

Django-tables2 footer sum of computed column values

Selectively retrieve data from tables when one record in first table is linked to multiple records in second table

Divide bootstrap 4 card footer into 2 sections

Footer in b-table is not displayed - Bootstrap-vue

Django: migrations for tables that are not linked to models

JTextArea not wrapping when parent shrinks

Div shrinks when border is removed

Bootstrap tables not in columns when width of one table is large

Bootstrap modal is showing as disabled when I use id=footer

Bootstrap fixed position left column that becomes fixed when footer in view