Add support for className
See original GitHub issueIs your feature request related to a problem? Please describe.
While there is support for <MaterialTable style={{}} ... />
, there does not seem to be support for <MaterialTable className={} ... />
.
Describe the solution you’d like
I want to be able to define a CSS class name using <MaterialTable className={classes.myTable} ... />
or <MaterialTable className='myTable' ... />
…
Describe alternatives you’ve considered
Wrapping the <MaterialTable />
in a <div>
and using CSS to find it that way (hacky).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:21
- Comments:11
Top Results From Across the Web
How To Add a Class Name - W3Schools
Learn how to add a class name to an element with JavaScript. Add Class. Click the button to add a class to me!...
Read more >Element.className - Web APIs | MDN
The className property of the Element interface gets and sets the value of the class attribute of the specified element.
Read more >Add CSS Support for className Attribute in React JSX syntax
In React JSX syntax you have to use the attribute className instead of class as described here: https://facebook.github.io/react/docs/jsx-in-depth.html
Read more >JavaScript adding a class name to the element - GeeksforGeeks
Using .add() method: This method is used to add a class name to the selected element. Syntax: element.classList.add("newClass ...
Read more >How to dynamically add a class to manual class names?
Depending on how many dynamic classes you need to add as your project grows it's probably worth checking out the classnames utility by ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So we don’t bloat the codebase, there is no need to add a className since we can already style material table with either style or by overriding the Container component like this:
I had to laugh at the comment
So we don't bloat the codebase,...
because inline styles are code bloat. Without reactclassNames
I can’t target table implementations and reduce code bloat via cascading styles. Plus, the source code is way bloated with all thestyle
objects. IMO, it’s a step backwards.