Reputation: 1366
I defined the table as below
class MyTable(tables.Table):
class Meta:
template_name = "django_tables2/bootstrap4.html"
model = Mymodel
attrs = {"class": "table table-hover"}
I want to change the table head to make appear light or dark gray, like this.
Upvotes: 0
Views: 1560
Reputation: 45
try this one:
attrs = {
'class': 'table table-hover',
'thead' : {
'class': 'thead-dark'
}
Upvotes: 2
Reputation: 13731
It's not explicitly in the docs, but judging from how it describes to set th
attributes from the Table.Meta.attrs property this is how you do it:
attrs = {
'class': 'table table-hover',
'thead' : {
'class': 'head-dark'
}
}
Upvotes: 0