Changing width of container div dynamically (JS)

Hello, I have my scheduler inside a container div, #table_area. If I use developer tools to set the width, the scheduler adjusts to fit.
Now I can open a window (window.open) for the user to print from, and copy the html across and it looks fine. However if there’s only a few weeks they look far too wide, so I’m using ignore_workweek to hide some of the columns. Then in the html I’m overriding the #table_area width to match the smaller table. But the table is then just chopped down and it doesn’t adjust.
Sorry that’s a bit involved but does anyone see how to do this?
Thanks

Hello,

If I understand correctly, you want to dynamically reduce the number of columns (days) shown in the scheduler when the container width approaches mobile sizes. You can achieve this by creating a custom week view with a configurable number of days, then switching views based on container width.

Check out the custom views documentation for the full guide.
And here is an example of how it might be implemented:
https://snippet.dhtmlx.com/obyfvvep

If this doesn’t resolve your issue, could you share more details?

Hello
Many thanks for this, but the problem isn’t the number of columns, but the size of the container div holding them. However I think I have realised the problem: I was just copying the already generated html code into the new window, so it was never going to be able to adjust the columns to fit the width. I need to let it do that before copying.
Thanks again, I think I’ll be able to work it out now.