MatthewHerbst / react-to-print

Print React components in the browser. Supports Chrome, Safari, Firefox and EDGE
MIT License
2.06k stars 221 forks source link

Print datatables #710

Closed Shubham-Nhance closed 2 months ago

Shubham-Nhance commented 3 months ago

I have a big data and want the height to adjust dynamically within the given space. i.e. if the row has more info the table overflows the conatiner otherwise works fine and if one row flows the rest of the pages gets affected. I am using material ui table in my project. The max-height is set to 80vh

MatthewHerbst commented 3 months ago

Hello. Are you having this issue only when printing, or also when not printing? If you could share some code that would be helpful, ideally a Codesandbox with a working example of the problem please.

Shubham-Nhance commented 2 months ago

@MatthewHerbst Thanks for your time, I resolved the above issue.

MatthewHerbst commented 2 months ago

Glad you got it resolved! Do you mind sharing your solution so that if others run into the same issue in the future they can know how to solve it?

Shubham-Nhance commented 2 months ago

Ya sure!! So there was a css mistake where I was giving the component a fixed height to resolve it I gave it a min-height and max-height and it resolved the issue.