what is faster and lighter to render (ul-li or table)?

Asked

Viewed 69 times

2

I am making a dynamic menu with table (6 columns already defined and the row will vary) and bootstrap. would like to know what is the best structure to build a dynamic menu (the user will choose several options, will be able to clone the line, etc)

for(var i =0; i< arrSequencia.length;i++ ){
strInterface += "<tr class='formulario'>"+
    "<td class='col-md-1'>"+
        "   <input type=\"button\" class=\"btn btn-danger btn-info-bloco sembloco\" value=\"Botao "+arrSequencia[i]+"\"/>"+
        "</td>"+

    "</tr>";
}

I am implementing so... ul-li is faster and light to render?

  • I would say the quickest way is to do it on the server... in HTML I don’t think there are relevant differences.

  • ideal is to make these menus dynamic on the server? I did everything in html.

  • ul-li would be more suitable for menus, already the Table is most indicated and recommended only to show data.

  • as good practice, the ideal is with ul-li then?

  • 1

    yes, the ideal and recommended. Table just to show data.

  • @Denali, a little piece of advice, instead of putting html in your hand, try using some template engine for this, I made a small example using Handlebars(http://handlebarsjs.com): http://jsfiddle.net/xrkuj8w3/. I believe this can simplify your work.

Show 1 more comment

1 answer

0

Friend I believe that the best way to work today would be using Fixed data Tables with React, with this becomes much more performatic, da uma olhada no https://facebook.github.io/fixed-data-table/ that you will like.

Note: Someone correct me if I’m wrong!

  • But the idea is to build a menu and not a data list. It would not be interesting to use tables in this. ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.