Same code but different results??
Im building a dashboard (responsive) and in the main dashboard page, the TodaysSchedule and OverdueInvoices are responsive (when sized down they go to new lines and the contained content is scrollable), heres what I mean:
But in the Clients page, I also have a table and the issue is that on a smaller screen (it works on md, this is whatim trying to achieveon a smaller device), the whole table components goes off the device width and is not making the content scrollable, can someone please help:





7 Replies
How are they becoming scrollable now?
without knowing how it's currently being done, it's pretty hard to say why it might not be working in different situations 🙂
sure, let me show you what the code looks like real quick
so I have a layout and this is what it looks like:
heres the main dashboard page:
and here are the code for the DashboardTodaysSchedule and DashboardOverdueInvoices:
this is what they mainly look like, just somedifference in the actual content
and heres my code for the clients page (it uses the dashboard layout the first code block i snet):
the DashboardClientsTable is whats causing the issue (i think, maybeit could be the formatting of the parent elements) but the DashboardClientsTable is really similar to these but it still goes off of the device screen on smaller devices instead of the container element taking up around 90% of the width and table inside being horizontallyscrollable
please help, ive been stuck on this for ages
im happy to give the full code if needed
not a ton to go on, but my initial thought is the schedule and overdue invoices are inside the grid with 2 columns... the table has the overflow-x-auto on it.
The grid is controling the size, and then they are fitting in the available space.
When it's by itself, there is nothing to limit the size of it? If I understand ,its's just living in this area: (??)
Like, this is a very simplified example, but even though my table has an overflow-y: scroll on it, it never overflows, it's the parent that does.
https://codepen.io/kevinpowell/pen/KwpLwGK/2e6d48a609a7035bb25ede5123e904d3
This is just me guessing right now though.
havent tried it yet cuz im afk but you actually responding and taking time out of your schedule to help me out really touched me bro no homo
legend, subcribingto u on myother accs
oncei get back ill try it out and let u know
yup its working now!

i added grid to the parent container of the table
do you know why this happened?
Flex children will shrink to as small as they can get, and then the parent sees that as it's minimum size, so it overflows, rather than the child overflowing. With grid, the cells define the size the children have, so it's much easier to "invoke" overflow of the children.