Multiple tables, height and auto row Height

Multiple tables, height and auto row Height

honeybadger666honeybadger666 Posts: 2Questions: 1Answers: 0

I have three tables in the same web page. We will refer to them as table#1, table#2, table#3. We have table#1 is on the top, then table#2, then table#3. Now, each table height will grow and shrink based on the number of item in each table. If the tables don't have any space to grow, we would like then to have the rows to auto shrink to fit more rows. For example, let's say table#1 will have a space for two rows, table#2 space for 5 rows, and table#3 will have a space for 10 rows. Now let's that table#1 has only 1 row used, table#2 has 3 rows are used and table#3 has 6 rows are used. In this case nothing will need to change on any of the tables, because all of the values are within range. Now we have this scenario, where table#1 has 1 row, table#2 has 7 rows and table#3 has 5 rows, now since our table#2 has more than the original 5 rows allocated for it, we need table#2 to borrow 2 rows from table#3. Now, if none of the tables have rows to give, then we would like to squeeze the rows height for the table that needs it. This scenario will be when for example table#1 has 1 row, table#2 has more than 8 rows and table#3 has 9 rows. Here table#1 will give table#2 1 row, and table#3 will give table#2 one row, and table#2 has 1 more row to deal with, then we will have to squeeze the rows height on table#2.
Any idea how to handle this.
Thank you.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • honeybadger666honeybadger666 Posts: 2Questions: 1Answers: 0

    Hi Colin:
    http://live.datatables.net/lojanoti/2/edit
    For example table # 3 has one row that does not fit in the view without scrolling. What I need to do is to move table#3 up and borrow that space from table#2.
    I hope that is enough information for you to see.
    Thank you.
    Hanna

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Probably the way to go would be to size up each table before you initialise them by counting the numbers of rows, then setting scrollY accordingly.

    Colin

This discussion has been closed.