That's still possible, just have to do things a little differently. var sd = $('#somediv'); $('<table><tr class="head"><td>generic header stuff</td></tr></table>') .insertBefore( sd ) .find('tbody') .append( sd.wrap( '<tr class="main"><td></td></tr>' );
Note: The 'tbody' is an element that gets created for you by the browser to wrap the 'tr's when you create a table. There's also 'thead' and 'tfoot', which you can insert yourself. They come in handy for styling, and I find them "cleaner" than using a '<tr class="heading">' sort of thing. Karl Rudd On Sat, Feb 23, 2008 at 7:09 AM, jquertil <[EMAIL PROTECTED]> wrote: > > John, > > I had simplified my example, sorry. > From what I gather, wrap() won't work for this kind of table: > > <table><tr class="head"><td>generic header stuff</td></tr> > <tr class="main"></td>...now wrap this...</td></tr></table> > > > > "John Resig" wrote: > > I think you want .wrap(): >