Force rows to not resize and some important questions!!

Force rows to not resize and some important questions!!

luloxynluloxyn Posts: 23Questions: 5Answers: 0
edited August 2018 in Free community support

Hello,
Let's say I have this:

Page 1: 10 rows
Page 2: 10 rows
Page 3: 2 rows

The rows of page 3, are changing size to "fit" in the same space of 10 rows, I'd like to force them to stay all the rows with the same size no matters if there's blank space:

Example:
Re-sized rows:

How I'd like to be even if there are only 2 rows:

Is this possible?

Other questions:
1- When adding a new row. Is there any possibility to highlight it like 2-3 seconds?
2- Is possible to add an image to a cell?
3- It's possible to add a button in a cell and trigger event when the button of that cell is pressed?

Thanks!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,301Questions: 26Answers: 4,946

    The rows of page 3, are changing size to "fit" in the same space of 10 rows, I'd like to force them to stay all the rows with the same size no matters if there's blank space:

    Not sure I understand. Taking a look at this example:
    https://datatables.net/examples/basic_init/zero_configuration.html

    When going to the last page the table has fewer rows so everything adjusts up. Are you saying this doesn't happen for you? If this is the problem then please provide a test case so we can see what you are doing.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Otherwise please provide more details of the problem.

    When adding a new row. Is there any possibility to highlight it like 2-3 seconds?

    This is something you would need to write the code for. One option is to use the Select Extension to do this with the API. You would need to know which row was added then select it for a few seconds then deselect it. This example shows how to select and deselect though the API:
    https://datatables.net/extensions/select/examples/api/select.html

    Is possible to add an image to a cell?

    Use columns.render for this. There are a couple examples (not specifically images) that should get you started. Also I remember some threads on the forum about this that may help.

    It's possible to add a button in a cell and trigger event when the button of that cell is pressed?

    Same as the previous answer.

    Kevin

  • luloxynluloxyn Posts: 23Questions: 5Answers: 0

    Thank you for your answer @kthorngren

    May I didn't explained it correctly:
    If we use this example:
    https://datatables.net/examples/basic_init/zero_configuration.html

    The last page:

    Let's say each row has 2cm. 2x10 = 20cm every 10 rows.

    But in my case, when there are only a few rows it takes the size of the other missing rows. When you keep adding new rows, the older rows then start to resize to smaller.

    I want to force my rows to stay always at "2cm" size.
    Do you understand what I mean now?

    Regards.

  • kthorngrenkthorngren Posts: 21,301Questions: 26Answers: 4,946
    Answer ✓

    The example seems to keep the same row height on the last page with fewer rows. The behavior of your table seems different, correct?

    If your table behaves differently then there is something in your environment changing the behavior. Please post a link to your page or a test case showing the issue so we can help debug.

    Kevin

This discussion has been closed.