Hiding header row of table?

Hello,

What would be the easiest way to hide the header row of a table? I’d like to create a table that does not have a header row describing what’s in the table.

Would the most straightforward way being to edit the css?

Thanks,
Ajay

The most straightforward way is to use Table.setColumnHeaderMode() method:

Table t = new Table(); t.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); No need to write any CSS.

Worked, thanks for your assistance Jouni!

Hi Jouni,

Is it possible also to hide the panel head? Thank you in advance.

Do you mean the caption?

Panel yourPanel = new Panel(null);

or

Panel yourPanel = new Panel("Your text.");
yourPanel.setCaption(null);
table.setColumnHeaderMode(Table.[s]
COLUMN_HEADER_MODE_HIDDEN
[/s]);

For vaadin 7.1.5 this code is deprecated. I look for another function but i didn’t find anything.
I don’t understand very well the subtlety .

Try using

ColumnHeaderMode.HIDDEN

Hi Mahipal,

Thanks it works.

menu.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);

I tried the above suggestion and it isn’t working. I am getting a runtime error about Table not being defined. I noticed this post is quite old; has things changed?