I have some custom fields/modules in my Django admin template "app_index.html". Looking like this:
<tr>
<th>Element 1</th>
<th>Element 2</th>
</tr>
In firebug I can see that this field inherits from Django's base.css which says:
.dashboard .module table th{
width:100%
}
I have by now understood that if a field inherits from width: 100%, then width:auto will not work.
In firebug, if I disable the width:100% property it works, but then other things in the admin interf开发者_高级运维ace is broken.
I have also tried defining my own .dashboard .module table th{width:auto} to override, but it does not work. Only if I in firebug disable it.
tl;dr: I want to disable CSS on elements, in django admin.
Semi-solution I found:
Since I did not want the lines to break I added a
white-space: nowrap
on the th's.
I tried with !important, did not work. Assigning it's own ID did not work either.
Hmm, as with the Django admin customization remains hard. But thanks for comments!
精彩评论