When I create a TabularInline in my Django's admin panel, it displays a title per record. How can I change this title? How can I delete this title?
I include a screenshot below. The title I am referring to is here ExportLookupTableElement object. The lines without that title are the extra fields to add new ones. I want the entire table to look like this.
You can remove this title by overriding Django's admin css:
css/custom_admin.css
in your static directory with following code:.inline-group .tabular tr.has_original td {
padding-top: 8px;
}
.original {
display: none;
}
admin.py
file to include this extra css for ModelAdmin that you want to remove title:class TestDetailInline(admin.TabularInline):
model = TestDetail
class TestAdmin(admin.ModelAdmin):
class Media:
css = {
'all': ('css/custom_admin.css', ) # Include extra css
}
inlines = [TestDetailInline]
Or you can override css for all admin pages by following this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With