Table - caption not visible

Hello!

I create a table with the code given below.

Unfortunately, the caption of it is not shown, when I run the application.

What am I doing wrong?

Here is the code:


		final Table scheduleTable = new Table(TM.get("dailyplanpanel.6-schedule-table-caption"));
		
		scheduleTable.setWidth("100%");
		
		scheduleTable.setSelectable(true);
		scheduleTable.setMultiSelect(false);
		scheduleTable.setImmediate(true);
		scheduleTable.setEditable(false);
		
		scheduleTable.addContainerProperty(COLUMN_SCHEDULE_NUMBER, Long.class, null);
		scheduleTable.addContainerProperty(COLUMN_SCHEDULE_FROM, String.class, null);
		scheduleTable.addContainerProperty(COLUMN_SCHEDULE_TO, String.class, null);
		scheduleTable.addContainerProperty(COLUMN_SCHEDULE_PROCESS, String.class, null);

		
		scheduleTable.setColumnHeader(COLUMN_SCHEDULE_NUMBER, TM.get("dailyplanpanel.7-schedule-table-COLUMN_SCHEDULE_NUMBER"));
		scheduleTable.setColumnHeader(COLUMN_SCHEDULE_FROM, TM.get("dailyplanpanel.8-schedule-table-COLUMN_SCHEDULE_FROM"));
		scheduleTable.setColumnHeader(COLUMN_SCHEDULE_TO, TM.get("dailyplanpanel.9-schedule-table-COLUMN_SCHEDULE_TO"));
		scheduleTable.setColumnHeader(COLUMN_SCHEDULE_PROCESS, TM.get("dailyplanpanel.10-schedule-table-COLUMN_SCHEDULE_PROCESS"));

The table is located inside a split pane.

Thanks in advance

Dmitri

Hi,

In Vaadin, captions are handled by layouts and apparently SplitPanel doesn’t support displaying captions. So in order to display Table’s caption, you have to wrap your Table into another layout (for example CssLayout) and add the layout to the SplitPanel.

-Henri

Thanks!

Dmitri

Hi,
after 5 years this discussion seem to be still actual at least for me - the SplitPanel has the same problem.

OK - I have a VerticalSplitPanel. The both componenets of them are Grids wrapped by a CssLayout as recomended. So I see the captions. However inspite of setting of height for both grids to 100% it seems to be so, that they take 100% + the size of the caption each.
I ran it with debug to show you how it looks like. Do you have an idea?

Thanks
Alex

And here is the scrrenshot - sorry :slight_smile:
20811.jpg

That’s because you use CssLayout; try VerticalLayout instead. CssLayout is very limited in handling sizes, as it is meant to be customized with CSS instead of only Java code. Bottom line; verticallayout will work out of the box in your case, with csslayout you need to play with paddings and margins yourself.

In this particular case it works now. Thanks a lot!