Wednesday 15 July 2015

Tables jquery/javascript -


I have two problems when the "ante" button is pressed, then I'm trying to dynamically create tables .

  function command line () {$ ('#write'). Bind ('keypress', function (e) {if (e.keycode == 13) {var $ table = $ ('& lt; table & gt;'); // taboy var $ tbody = $ table.append ( '& Lt; tbody />').children('tbody'); // add the line $ tbody.append ('& lt; tr />').children('tr:last') .append (" & Lt; TD & gt; Router # & lt; / td & gt; "); // $ table dom.appendTo ('# console');}); }   

This code works, but when I hit the hit, I do not get 3 rows and any columns. I need to enter 1 row with 2 columns and get 1 row. Please help!

OK, I'm getting it completely right. You have not specified the second column or anything in your code, the column object is here:

  $ tbody.append ('& lt; tr />').children('tr: Last ') .append ("& lt; td> router # & lt; / td>;) Attachment ("& lt; td> Column 2 ;); // ^ Add another column cell   

body:

No comments:

Post a Comment