How to get correct table format ? Jquery ques..

Posted by Sakti on Stack Overflow See other posts from Stack Overflow or by Sakti
Published on 2010-06-08T08:52:53Z Indexed on 2010/06/08 9:12 UTC
Read the original article Hit count: 173

Filed under:
|

This code prints output as given below... code:

$('#calendar').append('<table><thead><tr>');
    var i;
    for(i=0;i<=6;i++)
        {
            $('#calendar').append('<td>'+week[i]+'</td>');
        }
    $('#calendar').append('</tr></thead>');
    $('#calendar').append('</table>');

output:

<section id="calendar"><table><thead><tr></tr></thead></table><td>Sunday</td><td>Monday</td><td>Tuesday</td><td>Wednesday</td><td>Thursday</td><td>Friday</td><td>Saturday</td></section>

But i expect something in this structure..

<table><thead><tr><td>...</td></tr></thead></table>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about js