I need to read an existing table with Javascript and then copy and paste it in a popup. After that I've done that, I need to dynamically change the table. The copied table in the popup must have the same rows, but it must have also a fixed height. The table to copy does not a have a fixed amount of rows. The popup content must be printed on paper, so I cannot apply a simple overflow to the table. I don't want to reduce the font size to insert everything in the fixed space, but I would like to dynamically extend the table width if the readed content is to long. For example, here is my starting table (6 rows):
H1 H2 H3
TD1 TD1 TD1
TD2 TD2 TD2
TD3 TD2 TD3
TD4 TD4 TD4
TD5 TD5 TD5
TD6 TD6 TD6
The copied table should be something like:
H1 H2 H3 H1 H2 H3
TD1 TD1 TD1 TD4 TD4 TD4
TD2 TD2 TD2 TD5 TD5 TD5
TD3 TD2 TD3 TD6 TD6 TD6
Or
H1 H2 H3
TD1 TD1 TD1 TD4 TD4 TD4
TD2 TD2 TD2 TD5 TD5 TD5
TD3 TD2 TD3 TD6 TD6 TD6
(I do not care to repeat the headers).
What's the fastest/smartest way to do that?