开发者

Override and disable Django admin CSS .dashboard .module table tr

开发者 https://www.devze.com 2023-02-18 14:35 出处:网络
I have some custom fields/modules in my Django admin template \"app_index.html\". Looking like this: <tr>

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消