How to fix/set column width in a django modeladmin change list table when a list_filter is added?

You may want to refer to this: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-template

basically, the change_list.html needs to be overridden .

you can do it this way:

templates/
  admin/
    app/
      change_list.html

you can obtain a copy of change_list.html from django/contrib/admin/templates/admin/

and update the css the way you desire.


admin.py:

class MyClassAdmin(admin.ModelAdmin):

    class Media:
        css = {
            'all': ('fancy.css')
        }

fancy.css:

.column-foo {
    width: 20px;
}

where "foo" is a field name.

Source: https://docs.djangoproject.com/en/3.0/topics/forms/media/