Vertical page fitting - Error

Vertical page fitting - Error

gustavorieggustavorieg Posts: 6Questions: 0Answers: 0

I have a problem using this CDN:
https://cdn.datatables.net/plug-ins/1.13.7/features/pageResize/dataTables.pageResize.min.js

The page does not update the number of rows in my table depending on the screen size.

It removes all rows from the table leaving just one

Replies

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    All of the examples in the blog seem to be working. I would start by looking for errors in the browser's console.

    We will need to see the problem to help debug. Please post a link to your page or a test case replicating the error.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • gustavorieggustavorieg Posts: 6Questions: 0Answers: 0
    edited December 2023

    my code is normal, without any errors:

    printscrenn

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin

    As Kevin requested, please link to a page showing the issue so we can help to debug it.

    Allan

  • gustavorieggustavorieg Posts: 6Questions: 0Answers: 0
    edited December 2023
  • gustavorieggustavorieg Posts: 6Questions: 0Answers: 0
    edited December 2023

    Sorry, the link I took the example from is this:

    https://datatables.net/blog/2015-04-10

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974
    edited December 2023

    Your test case doesn't run to show the issue. I built one for you:
    https://live.datatables.net/qemelowo/1/edit

    I believe the test case meets all the requirements of the plugin. Resize the page and you will see only one row displayed in the table. Also on page load it displays only 7 rows. @allan will need to take a look at the plugin code.

    Kevin

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin

    The container doesn't have a height specified, so there is nothing to match the height of. If I set it to the viewport height it works: https://live.datatables.net/kofuhohi/1/edit .

    Allan

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    I may have missed it but I didn't see anything in the blog indicating this requirement. If its not in the doc nd its appropriate can the requirements be updated to include that the container needs a height specified?

    Kevin

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin

    Yup, good point. I'd thought some words to that effect were in there, but apparently not! I've added:

    • The container element that the DataTable sits in must have a defined height that the table is to fill (the height can be flexible, e.g. vh CSS units).

    to the requirements section in my git repo and it will be deployed soon.

    Allan

  • gustavorieggustavorieg Posts: 6Questions: 0Answers: 0

    if I prefer to activate scrolling in my table, and for it to occupy 100% of my parent div, and be flexible. how to make?

  • gustavorieggustavorieg Posts: 6Questions: 0Answers: 0

    I'm declaring my Y at 40vh, in case I want to apply 80vh to another screen size?

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    Maybe the solution in the first blog I linked to will do what you want.

    Kevin

Sign In or Register to comment.