简体   繁体   中英

What is the easiest/correct why to change the width of django_tables2 table

I want a table rendered by django-tables2 to be drawn over the whole screen. I'm using the included paleblue css.

class PoolTable(tables.Table):
    class Meta:
        model = Simple 
        attrs = {'class': 'paleblue','width':'100%'}
  • Is it possible to do this fairly easy in the code and if so how?
  • If you can't easily do this in the code, what must I change in the css or html or any other place?

This is more of a css question. Here is how I did it the easy way:

chang the width to be over 100%

class PoolTable(tables.Table):
    class Meta:
        model = Simple 
        attrs = {'class': 'paleblue','width':'200%'}

This will only change the size of the table not the pagination. If you wont to change the its size you have to change it in the css. I did find it easiest to just remove the borders from the pagination.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM