This topic contains 5 replies, has 2 voices, and was last updated by Jai Jai 3 months ago.

Metronic DataTable – Column Render with SVG files


  • willaguilar
    Participant

    Posts: 46
    Member Reply #18154

    Does the Metronic DataTable supports SVG files when rendering columns? I have tried and it seems it doesn’t recognizes the file.

    Jai
    Jai
    Keymaster

    Posts: 2693
    Support Staff Reply #18175

    Hi 🙂

    The datatable rendering does not support SVG. How did you include SVG into datatable?

    Thanks


    willaguilar
    Participant

    Posts: 46
    Member Reply #18199

    I took the Column Rendering example, instead of using PNG or any other picture formats I’m using SVG. I got the SVG working by adding the width manually:


    img class=”m–img-rounded m–marginless” src=”/assets/media/img/flags/’ + row.flag + ‘” alt=”photo” width=”40px”

    The problem is that the class assign to the picture doesnt recognize SVG so the width is never set.

    • This reply was modified 3 months ago by  willaguilar.
    Jai
    Jai
    Keymaster

    Posts: 2693
    Support Staff Reply #18241

    Hi 🙂

    We don’t have class name m–img-rounded and m–marginless. Can you set the width via style attribute?

    <img style=”width:40px;”

    Thanks


    willaguilar
    Participant

    Posts: 46
    Member Reply #18277

    Jai, you are right the classes are:

    • m-–img-rounded
    • m–-marginless

    And the only way I got the SVG files to work is, like I said before and you suggested in your last post, by adding the inline attribute width to each img tag.

    Jai
    Jai
    Keymaster

    Posts: 2693
    Support Staff Reply #18315

    Hi 🙂

    Then what is the issue? What do you mean by “class assign to the picture doesnt recognize SVG “?

    Thanks

Tagged: 

You must be logged in to reply to this topic.