Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8851497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:10:11+00:00 2026-06-14T13:10:11+00:00

below is my html <table id=myTable class=dropdown> <thead> ……….. </thead> <tbody class=myTbody1> <!– insert

  • 0

below is my html

<table id="myTable" class="dropdown">
 <thead> ........... </thead>
 <tbody class="myTbody1">
            <!--     insert here       -->
 <tbody class="myTbody2">
 <tbody class="myTbody3">
</table>

I need to insert the below html string right after the tbody, myTbody1

var html = '<tbody class="details" colspan="9">
<table>
    <thead> 
        <tr>
            <th> Col1 </th>     
            <th> Col2 </th>     
            <th> Col3 </th>     
            <th> Col4 </th>     
            <th> Col5 </th>     
            <th> Col6 </th>     
            <th> Col7 </th>     
            <th> Col8 </th>     
            <th> Col9 </th> 
        </tr>
    </thead>    
    <tbody class="head">    
        <tr class="nestedRow">              
            <td> Data</td>      
            <td> Data</td>
            <td> Data</td>
            <td> Data</td>
            <td> Data</td>
            <td> Data</td>
            <td> Data</td>
            <td> Data</td>
            <td> Data</td>
        </tr>
    </tbody>
</table>
</tbody>'

I tried to do like below and it inserts at right place but it is cutting the first two tags tbody and table from the html string.

$(html).insertAfter($(this));

where $(this) equals tbody.myTbody1

Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:10:12+00:00Added an answer on June 14, 2026 at 1:10 pm

    As specified, tbody can only contain tr elements. Since the HTML you’re passing is invalid jQuery just works with the valid portion that’s created in the DOM.

    To make a nested table like that you’ll have to add a tr and td element as children of the tbody and put the inner table inside the td.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please check my HTML below: <table cellpadding=0 cellpadding=0 border=0> <tr> <td> <div class=toogler>Demo1</div> </td>
I want to add Excel button below the html table, that gives an Excel
I m new with jquery.Below is my html table which is in content page.In
Given the following html table and script shown below I am having a problem
Below is my HTML : <table width=100% > <tr> <td> <asp:TextBox ID=tbNewNote TextMode=MultiLine runat=server
Conside below html - <div class=container1> <div class=container2> <div class=container3> <div class=container4> <div class=element>
I'm new with JavaScript and jQuery. I clonned below html table with this jQuery
I have an html table like below +-------+-------+-------+-------+-------+---------+---------+---------+---------+ | col1 | col2 | col3
I have a table displayed in HTML which has two kinds of class 1
I have a table for a menu like below (see the HTML section): http://jsfiddle.net/6YZzb/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.