我使用 django-tables2 创建了一个表:
class MyTable(tables.Table):
class Meta:
model = TestModel
attrs = {"class": "paleblue"}
在这张表中,我注意到当任何给定的单元格包含太多字符时,列宽会自动扩大。这有时会扩展到浏览器的可视区域之外。我尝试通过修改screen.css
django-tables2 提供的默认文件来添加滚动条(已添加overflow: scroll
):
table.paleblue + ul.pagination {
background: white url(../img/pagination-bg.gif) left 180% repeat-x;
overflow: scroll;
margin: 0;
padding: 10px;
border: 1px solid #DDD;
list-style: none;
}
虽然这会添加滚动条,但滚动条的右侧会随表格一起展开。因此我看不到滚动条的右半部分。此外,滚动条似乎没有“活动”,因为没有“栏”可以点击。
在 django-tables2 表中实现滚动条的正确方法是什么?