diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index 0a8d86fee4..859be8cec3 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -88,6 +88,7 @@ export class HaDataTable extends LitElement { @property({ type: Boolean, attribute: "auto-height" }) public autoHeight = false; @property({ type: String }) public id = "id"; + @property({ type: String }) public noDataText?: string; @property({ type: String }) public filter = ""; @property({ type: Boolean }) private _filterable = false; @property({ type: String }) private _filter = ""; @@ -197,7 +198,7 @@ export class HaDataTable extends LitElement { })}" style=${styleMap({ height: this.autoHeight - ? `${this._filteredData.length * 53 + 57}px` + ? `${(this._filteredData.length || 1) * 53 + 57}px` : `calc(100% - ${this._header?.clientHeight}px)`, })} > @@ -264,73 +265,85 @@ export class HaDataTable extends LitElement { `; })} -