Andy Thomas
Andy Thomas

Reputation: 1309

Material-table: how to give custom style to EmptyDataSourceMessage

Following this example: https://material-table.com/#/docs/features/localization

I would like to give custom style (basically color is my interest) to EmptyDataSourceMessage.

Any idea how can I do that?

Upvotes: 2

Views: 1083

Answers (1)

tw1742
tw1742

Reputation: 1484

I was able to add HTML the the EmptyDataSource message using this in the render function:

const emailContact = <a href="mailto:myEmailAddressHere">Email Info</a>;
const noResultsMessage = <span>No results were found. Please email {emailContact</span>;

and then in the return method adding:

localization={{
    body: {
        emptyDataSourceMessage: noResultsMessage
    }
}}

Upvotes: 2

Related Questions