• Resolved kasaflow

    (@kasaflow)


    Hi there,

    Thanks for the great plugin, first of all.

    I have a table that I’ll be adding lots of data to however I want it to be a fixed height. I’ve got it showing in a corner of my website however as the user goes through the pages of data, it reduces in size if there’s only a few bits of data and vice versa, it’ll increase back to it’s regular/normal size if there are enough data entries (default is 5 I think).

    How can I make it so that it stays/shows as a fixed height regardless of how many data entries there are? I’m guessing some CSS snippet?

    Anyway, hope that makes sense.

    Thank you for your time and effort!

    • This topic was modified 7 years, 11 months ago by kasaflow.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kasaflow

    (@kasaflow)

    I think I figured it out;

    table.tablepress-id-1 {
    height: 300px;
    }

    That seems to do the trick.

    Another question;

    Is there a way to make it so the user can scroll down/up to view the data instead of having to click on “next” to see the data until it ends?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, such CSS should work for setting a fixed height.

    Having vertical scroll instead of pagination is also a possibility. To enable that, just extend the Shortcode that you are using to

    [table id=123 datatables_scrolly=300px /]
    

    The 300px would be the height of the table, so adjust that and the table ID as necessary. Note that you might have to uncheck the “Pagination” checkbox to prevent conflicts.

    Regards,
    Tobias

    Thread Starter kasaflow

    (@kasaflow)

    Great!

    Thank you for the prompt reply.

    That bit of code definitely works.

    Also, how would I go about changing the hovering color when the mouse pointer is over a data item? I read the FAQ but I couldn’t get it to work properly.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Thread Starter kasaflow

    (@kasaflow)

    I figured it out. I was looking at the wrong color codes.

    Thank you!

    Once again, great plugin! Keep up the good work.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘How to set fixed height/width for table?’ is closed to new replies.