Assign number of row to show or fix height in table

Is there any way to assign number of row to show on table or specify
I have tried following and non of those works. but the height of area that showing content is alway 96 px. please see attachment.

.setPageLength
.setSizeUndefined();
.setExpandRatio(TBL, 1.0f);
setSizeUndefined
setSizeFull

and i tried to use css to assign height in “v-table-body-noselection”, but element.style always override value i assign.

following are code of my implementation.

Label failLBL = new Label();
failLBL.setValue(“The following error(s) / warning(s) were found when processing the import sheet. Please make sure you are using the latest import template.”);
failLBL.setStyleName(“failureMsg”);

        importMessageVLO.addComponent(failLBL);        
        
        
        Table importErrorTBL = new Table();
        importErrorTBL.setWidth(920, Unit.PIXELS);
        importErrorTBL.setStyleName("wordwrap-table");
        
        
        importErrorTBL.setSelectable(false);
        importErrorTBL.setColumnReorderingAllowed(false);
        importErrorTBL.setColumnCollapsingAllowed(false);
        importErrorTBL.setSortEnabled(true);
        importErrorTBL.setImmediate(true);            
        
        
        // Define the names and data types of columns.
        importErrorTBL.addContainerProperty("Sheet", String.class, null);   //0
        importErrorTBL.addContainerProperty("Row", Integer.class, null);         //1
        importErrorTBL.addContainerProperty("Column", String.class, null);      //2
        importErrorTBL.addContainerProperty("Name", String.class, null);     //3
        importErrorTBL.addContainerProperty("Type", String.class, null);        //4
        importErrorTBL.addContainerProperty("Message", Label.class, null);     //5
        int count = 0;
        for (ImportMsgLine message : messageList) {
            Object[] ipDataArr = new Object[6]

;
ipDataArr[0]
= message.getSheetName();
ipDataArr[1]
= message.getLine();
ipDataArr[2]
= message.getField();
ipDataArr[3]
= message.getName();
ipDataArr[4]
= message.getMessageLevel().toString();
Label reasonsLBL = new Label();
reasonsLBL.setValue(message.getMessage().toString());
reasonsLBL.setContentMode(ContentMode.TEXT);
ipDataArr[5]
= reasonsLBL;

            importErrorTBL.addItem(ipDataArr, count++);

        }
        importErrorTBL.setColumnWidth("Sheet",80 );
        importErrorTBL.setColumnWidth("Row", 50);
        importErrorTBL.setColumnWidth("Column", 50 );
        importErrorTBL.setColumnWidth("Name",150 );
        importErrorTBL.setColumnWidth("Type",150 );
        importErrorTBL.setColumnWidth("Message",360 );
        importErrorTBL.setHeight(320, Unit.PIXELS);
        importMessageVLO.addComponent(importErrorTBL);
        importErrorTBL.setPageLength(20);

– my style of wordwrap-table

.wordwrap-table .v-table-cell-wrapper {
white-space: normal;
}
13094.png

Table.setPageLength(int) should work. We use that all the time when we want to set a max/min number of rows to show. Since you were doing lots of other settings, you might want to be sure your other attempts, CSS, etc. are not specified to avoid any conflicts.

Oddly, sometimes on Chrome we’ve found that it mistakenly calculates this to be one row less than desired. (But not always, so there you have it!)

In addition: When using setPageLength your table has to have an undefined height. Otherwise the PageLength won’t be used.