jquery build table

Posted by kusanagi on Stack Overflow See other posts from Stack Overflow or by kusanagi
Published on 2010-04-26T21:10:04Z Indexed on 2010/04/26 21:13 UTC
Read the original article Hit count: 743

Filed under:
|
|

menuOrder is an empty div

$("#menuOrder").append('<table>');
                $(menus).each(function(i, menu) {

                    $("#menuOrder").append('<tr><td>');
                    $("#menuOrder").append(menu.text);
                    $("#menuOrder").append('</td><td>');

                    if (i > 0) {
                        $("#menuOrder").append('<img src="/images/_images/up.png" />');
                    }
                    else {
                        $("#menuOrder").append('<img src="/images/_images/blank.png" />');
                    }

                    if (i < menus.length - 1) {
                        $("#menuOrder").append('<img src="/images/_images/down.png" />');
                    }

                    $("#menuOrder").append('</td>');
                    $("#menuOrder").append('</tr>');

                });

                $("#menuOrder").append('</table>');

this code not work properly, how can i change it with mininun iterations?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about table