Remove inline style widths on Table & Cells

I want to use the Table component, but I want to remove all ‘set’ inline style widths of the table and cells.

Using setSizeUndiefined(), setColumnExpandRatio(“Results”, 1.0f); setWidth(100, Unit.PIXEL) all still seem to set actual pixel widths on the component.

How do I remove the inline styling in Java, not by overriding css styling?

I ended up doing a css override, however it would be nice if there are a ‘real’ base version of theme and components that do not do any size calculations.

I am working on a responsive design and Vaadin, out of the box, does not play nice.

Hi Stephen,

The Table component is one of the oldest and complex things in the framework, from a time when we needed to support ancient browsers like IE6 (and even older). The inline widths are mostly there to make it behave the same in all browsers, allowing the end-user to change the column widths by dragging the header edges.

The new, in development, Grid component should be more flexible in this regard. But as for now, the only real solution is a CSS override, which is quite acceptable in this situation. Just be aware that in some situation some of the Table’s features might not work correctly if you override those widths (namely column resizing and table header alignment).

Thanks Jouni.
I went ahead and extended many of the common components so that I can set the default style name and override most of the issues. I do understand that most of the Java functions on those controls, for styling etc, will most likely not work as expected. I will most likely reintroduce solutions to them, when I need them.