Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8927381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:12:47+00:00 2026-06-15T08:12:47+00:00

I use CustomLayout in my project to separate UI object and their style. I

  • 0

I use CustomLayout in my project to separate UI object and their style.

I have some problem with tables.

I define a div and I want the table’s height set to div’s height.

Which is the best way?

I thought:

table.setsizeFull() ;
table.setPageLength(0);

in the code, but the result is not what I want.
I want the table full sized in div’s dimensions, both with or without elements inside.

Any suggest?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:12:48+00:00Added an answer on June 15, 2026 at 8:12 am

    I was solving a similar problem: I wanted a table to grow as I added rows to it. I didn’t care about its exact height, as long as it showed all the rows of data, and grew as I added rows. I also wanted the table to always show some extra space at the bottom.

    The core idea here is that I did three things:

    • Do not call setHeight() for the table.
    • I used setPageLength() to define table height by rows–by how many rows high the table should be.
    • I called requestRepaint() on the element I resized. If I resized a column element, I called it on the column element. If I resized the table, I called it on the table.

    Here’s a generalized code sample showing how I solved this problem. My code isn’t complete, but it might help you get started.

    public class MyClass extends Table {
    
        public MyClass(...)
        {
            this.setWidth("100%"); // fill parent <td>'s width, allows draggable sizing.
            // note: do NOT setHeight().
    
            setupColumns(); // details not shown here
            setupBehavior(); // details not shown (listeners, etc)
            addDataToTable(); // details not shown
    
            adjustHeight();
        }
    
        // I also have a function to add rows to the table when 
            // a button is clicked.  That function calls adjustHeight() (shown below).
    
        public void adjustHeight()
        {
            this.setPageLength(this.getItemIds().size() + 1);
            this.requestRepaint();
        }
    }
    

    [EDIT/FOLLOW-UP] I’ve found that using this method tends to cause unnecessary scroll bars to be rendered on tables if you are using setColumnExpandRatio() (dynamic column widths). So just as a heads-up, you should use fixed width columns (setColumnWidth()) if you use the trick I showed above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a controller with some methods and I want to use the default
I use Vaadin in my project, currently i'm having a problem with it. It's
Hi i want to make two items to have a CustomLayout and the other
use C#,want to upload excel file on google doc. bellow syntax use to upload
use Text::Table; my $tb = Text::Table->new(Planet,Radius\nkm,Density\ng/cm^3); $tb->load( [ Mercury,2360,3.7], [ Mercury,2360,3.7], [ Mercury,2360,3.7], );
I have two Android projects, a 'library project' containing a custom layout, and an
Im creating a custom layout and I want to use the text declared in
I do not want to use TableLayout because my data model and UI perfectly
I have customised my SeekBar - I use a custom image as the background,
I need to use Android ExpandableListView with custom layout for each group(groups have one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.