diff --git a/wagtail/admin/ui/tables/__init__.py b/wagtail/admin/ui/tables/__init__.py index 8c593711b3..b483f0f0b0 100644 --- a/wagtail/admin/ui/tables/__init__.py +++ b/wagtail/admin/ui/tables/__init__.py @@ -141,6 +141,7 @@ class Column(BaseColumn): """A column that displays a single field of data from the model""" cell_template_name = "wagtailadmin/tables/cell.html" + empty_value_display = "" def get_value(self, instance): """ @@ -163,7 +164,11 @@ class Column(BaseColumn): # on templates to be explicitly localized or unlocalized. For numeric table cells, we # unlocalize them by default; developers may subclass Column to obtain formatted numbers. value = unlocalize(value) - context["value"] = value + + if not str(value).strip(): + context["value"] = self.empty_value_display + else: + context["value"] = value return context @@ -185,6 +190,7 @@ class TitleColumn(Column): """A column where data is styled as a title and wrapped in a link or