How to change the font size of Grid elements in JavaScript?
You can customize the font style to the whole JavaScript Grid component by overriding the default CSS. This can be achieved by using the appropriate CSS classes for each Grid sections like header, content etc.
This is demonstrated in the below sample code in which the font size has been changed for Grid header, content and summary cells using corresponding CSS selectors. You can also use the Global selector to achieve the same.
CSS
.e-grid .e-headercelldiv, //for header .e-grid .e-rowcell, //for content .e-grid .e-summarycell, //for summary .e-grid .e-row .e-input-group .e-input.e-field { //for edit state font-size: 8px; }
OR
CSS
.e-grid * { font-size: 8px !important; }
Documentation : https://ej2.syncfusion.com/javascript/documentation/grid/how-to/grid-styling/
Demo : https://stackblitz.com/edit/customfontsize?file=index.html
Output
Conclusion
I hope you enjoyed learning about how to change the font size of Grid elements in JavaScript.
You can refer to our JavaScript Grid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Grid example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!