0

I have been trying to force a table to fit in a printable page, regardless of how many items exist and am having trouble doing so. the only way i have found is to change font size but that isn't exactly automatic.

i have found a lot of answers setting with to a specific width, but the vertical side is difficult. I dont want any overflow to occur and resize the text to show all content in that box.

like here

i have been using a setting of 300px wide and 777px tall

hammertime
  • 113
  • 6

2 Answers2

0

Should be as simple as:

table
{
 max-height: 300px;
 max-width: 700px;
}
table, table * {white-space: nowrap;}
John
  • 11,516
  • 11
  • 87
  • 151
0

Use in css table-layout:fixed. For more info: https://www.w3schools.com/cssref/pr_tab_table-layout.asp

Vugar Abdullayev
  • 1,424
  • 3
  • 17
  • 40