Skip to content

Change font-size in MudDataGrid #4597

Answered by iwis
ollih1980 asked this question in Q&A
Discussion options

You must be logged in to vote

Add this CSS:

<style>
    .my-class .mud-table-cell { font-size: 1rem; }
</style>

Then add to MudDataGrid:

  • HeaderClass="my-class" attribute to style only headers,
  • RowClass="my-class" attribute to style only data rows,
  • Class="my-class" attribute to style both headers and data rows.

Only headers: https://try.mudblazor.com/snippet/wYQQuguhQNUcJCMK
Only data rows: https://try.mudblazor.com/snippet/mYmwuUahRckBEMyT
Both headers and data rows: https://try.mudblazor.com/snippet/wkwmEUaBnQELnqiJ

.875rem is default value for font-size.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ollih1980
Comment options

You must be logged in to vote
1 reply
@ChrisGilson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants