How to customize buttons using row child with data tables

How to customize buttons using row child with data tables

DOUDOUDOUDOU Posts: 4Questions: 2Answers: 0

I used riw child with data tables. I want to customize the buttons (open_details and close_details). I want to use other images. Can you help me?

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770

    Take a look at this example:
    https://datatables.net/examples/api/row_details.html

    Click on the CSS tab. You will see the CSS that is loading the open and close png files. You should be able to change this to what you want.

    Kevin

  • DOUDOUDOUDOU Posts: 4Questions: 2Answers: 0

    I am following this example: https://datatables.net/extensions/responsive/examples/child-rows/whole-row-control.html
    The css tab does not contain details about these images. I tried to edit the "jquery.dataTables.min.css" file by adding:
    td.details-control {
    background: url('../img/myimage_open.png') no-repeat center center;
    cursor: pointer;
    }
    tr.shown td.details-control {
    background: url('../imgs/myimage_close.png') no-repeat center center;
    }
    but nothing is changed

  • asystemsausasystemsaus Posts: 15Questions: 5Answers: 0

    HI @DOUDOU
    I have

    <style>
    td.details-control {
    background: url('../img/myimage_open.png') no-repeat center center;
    cursor: pointer;
    }
    tr.shown td.details-control {
    background: url('../imgs/myimage_close.png') no-repeat center center;
    }
    </style
    

    In the head of my file. I can change the .png to anything I like and it works fine.
    The only issue is if you try to use something too big... it looks a bit silly.
    As long as you have the images in your imgs folder it should work.

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    Duplicated thread, please post just once.

This discussion has been closed.