Edit 08.02.2017: I am not required to support every browser since I am utilizing the latest electron-framework
, which is based on Chromium 56.0.2924.87
I have an editable table
that is preloaded with data before allowing user edits. In order to print this table in A4 Format without exceeding a certain width, I need to ensure it remains within the given dimensions.
The complication arises when using
table-layout:fixed;
width:100%;
as the editable TDs
lose their fluidity. Although I understand the contradiction - something being both fixed
and fluid
simultaneously isn't possible...
However, I am confident that in 2017 there must be a way to achieve a fixed table
while keeping the TDs
fluid.
Here is an example without the fixed table: https://jsfiddle.net/stjkd2xs/
As shown, with shorter words, the table
fits inside its parent container. The TDs
are fluid. But longer words cause the table
to break out of its boundaries.
Here is an example with a fixed layout: https://jsfiddle.net/jdedo87z/
In this case, the table
expands to fill the entire parent container, which is desirable. However, the TDs
have fixed widths, which is less than ideal.
I am seeking a solution where the TDs
can behave in a fluid manner within a fixed-width table
.
- Is there a pure CSS method to accomplish this?
- Are there other approaches to resolving this contradiction?
- Sidenote: I am considering scrapping the
table
altogether and usingdivs
instead...
Thank you for any advice or suggestions.
Regards, Megajin