-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Material Table is not responsive #1395
Comments
Any visibility on this whether this is going to be implemented in the library sooner or later? |
What to do here... I don't see this lib having it's own responsive solution. I mean what would it look like? It would depend on the very instance of the table that needs to be rendered on a small screen. User preferences would undoubtedly cause all kinds of issues. The only reasonable solution I can see is to implement horizontal scroll at some min width similar to material-ui table. I like @kkateli idea of using a material-ui list to display an alternate view. Probably can do this pretty easily, but with significant drop in usability. e.g. sorting. Search might not be too bad. And list can be virtualized with react window Anyway I think rolling your own mobile display is the better solution, with horizontal scroll being a best solution for this library. |
Horizontal scroll is apparently the default behavior already. I'll have to see why it's not scrolling on my table. |
@JeffEmery Mine is not horizontal scrolling either. Did you figure out what was disabling it? |
@JeffEmery @hatchli Mine was not scrolling because the table was under a I wonder if it's possible to still make it horizontal scrollable with |
@hatchli I think I had the same issue as @LuanScudeler . Once I dismantled all the containers above the table, the horizontal scroll began working. I didn't narrow it down to |
Is there any progress on this issue? horizontal scrolling is really ugly on mobile and I really like material-table and don't want to switch. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required. |
Bump |
any updates? |
Check out mui-datatables. They handle responsiveness very well! Would love to see something similar implemented in this library. |
I'm also having this same issues. Changing tables at this point is less than desirable though :D |
no updates? |
Yes!! this would be so much better & helpful! I support the stack implementation for mobile view |
Still no update I guess |
Any update? |
|
any update? |
Updates? |
still no update... |
Im really surprised this is not a feature in Material UI and it's problematic to see no further updates on this issue. Even Vuetify which is modelled after Material UI in its early versions has this feature. Hope Dev's notice this. |
@JeffEmery @hatchli @LuanScudeler... Regarding horizontal scroll within a |
If someone is still facing this issue.. I did it this way
Also give individual headerStyle: {width: ''} to each column header in 'px' to exceed total beyond screen size. My material table version is "material-table": "^1.54.1", |
@NikhilChugh Can you share full code example? I tried your solution but it is not working for me |
@kadirtereci check this code function Editable() { const [columns, setColumns] = useState([ const [data, setData] = useState([ return (
) export default Editable; ` This will only make material table horizontally scrollable. Hope it helps |
I had the same issue, but did like this: const useStyles = makeStyles((theme) => ({ const theme = createTheme(); function App() { const width = useWidth(); export default App; if you want to make component smaller you can create reusable component for each column "render" and even make this MaterialTable component reusable. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required. |
Bump. |
Cant believe there is no formal solution to this since. |
i cannot believe. But this is the reality : ( |
Any update on this issue? |
Give a try on https://github.com/archfz/vh-sticky-table-header . This allows for both sticky header and also horizontal scrolling on mobile (it doesn't use display sticky, to support on parents different displays and overflows). |
Alternatively, material-table could have the built-in capability to render each row as a different component on shorter widths, like bootstrap-table: I understand some existing features (e.g. grouping?) might be challenging to implement with this approach, so a good idea would be to empower the developers to render their own responsive row, as long as the component has access to the row data and table state: <MaterialTable
title="Users"
data={users}
columns={[
{ title: "Name", field: "name" },
{ title: "Email", field: "email" },
]}
components={{
ResponsiveRow: ({ rowData, state }) => <UserCard user={rowData} />
}}
/> What are your thoughts? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required. |
For Any one having this issue just use the following
|
Material Table is not responsive. It only reduces the width of the table when shrinking a page. A lot of other table libraries create "stacked" table in mobile view (e.g. https://github.com/gregnb/mui-datatables). Is it possible to have this stacked table view in the near future? I reckon It would be nice to swap the table to Material UI list in mobile view.
Taken from:MUI datatables
The text was updated successfully, but these errors were encountered: