How to give a column in the Django admin change_list a CSS class

后端 未结 3 1965
梦如初夏
梦如初夏 2021-01-06 09:44

I\'d like to change the column widths in the list display of the Django admin.

Is it possible somehow to add a CSS classname to a column? I\'d preferably not overwri

3条回答
  •  北海茫月
    2021-01-06 10:48

    In Django >= 1.6, CSS classes are included with list_display output:

    "The field names in list_display will also appear as CSS classes in the HTML output, in the form of column- on each element. This can be used to set column widths in a CSS file."

提交回复
热议问题