Overlay image in a cell

Overlay image in a cell

classic12classic12 Posts: 228Questions: 60Answers: 4

Hi Guys,
I am pulling an Image for the first cell and some text for the second cell from a database.
I have a responsive layout using the following:

'''
columns: [

        { data: "blogTitle" , title : "Title" , width : '20%',
        render : function ( data, type, row) {
        return '<img style="vertical-align:middle horizontal-align:middle" width="100%"  src="'+data+'"/>';

        }
        },
        {data: "notes", 
        title : "Details",
        width : '80%',
        render: function ( data, type, row ) {
        return  "<div class='setRowHeight' "  + data + " </div>";
        }
        },


                  ]

'''

This all works fine.
I now need to overlay a 'play' button over the image that will scale with the image.

Cheers

Steve Warby

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I'm afraid that's really beyond the scope of the support that I can offer for DataTables. However, I would suggest putting the image in a position:relative div and then having the play icon as position:absolute.

    Allan

  • classic12classic12 Posts: 228Questions: 60Answers: 4

    Thanks Allan. I thought maybe another user had created this magic .....

This discussion has been closed.