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 8060939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:09:43+00:00 2026-06-05T10:09:43+00:00

I have a standard HTML formatted table, that dynamically generates the content, via Zend

  • 0

I have a standard HTML formatted table, that dynamically generates the content, via Zend Framework. From which I have an issue altering the form internally PHP side. So I need to alter the tables appearance somehow. With that on the occasion I have an element show up in one of the rows and when this element shows up I want to break out of the table and then do something after it then start the table again.

Basically I want to inject the equivlant of

</tbody></table>/*other stuff*/<table><tbody> after the row containing the one element I seek which in this case is a label.

I tried $("label[for='theLable']").parents('tr').after('</tbody></table><br><table><tbody>') which appears to ignore the ending table parts add the br, and then does a complete open/close tag for table and tbody within the same table I am trying to break out of so inbetween tr tags basically it adds this new table

Whats the best way to approach this concept?

update with jsfiddle link

http://jsfiddle.net/cPWDh/

  • 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-05T10:09:45+00:00Added an answer on June 5, 2026 at 10:09 am

    You can’t really modify the HTML of the document the way you’re thinking, since it’s not a legitimate way to alter the DOM.

    Instead, I would create a new table and .append the rows you want to move to it, which will automatically move them from their current location (instead of copying them):

    $(document).ready(function() {
        var $trow = $('label[for="specialLabel"]').closest('tr'),
            $table = $trow.closest('table');
        $('<table>').append( $trow.nextAll().andSelf() ).insertAfter($table);
    });​
    

    http://jsfiddle.net/cPWDh/1/

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

Sidebar

Related Questions

I have an html table that looks like this in a standard HTML 4.01
I have a standard HTML form on a WordPress post that the visitor will
Is there a coding standard for HTML? Please suggest links that have the coding
I have an HTML table with collapsed and adjacent borders and a standard border
I have a standard html form that uses a background image. I would like
I have a standard HTML login page, which I would much rather use than
I have a form that submits parameters using standard HTML controls to a PHP
I have a standard HTML input that I want to run JavaScript code when
I have a MultiLine asp:Textbox (a standard html textarea for those non-asp people) that
I have a standard HTML table. Using jquery how do I find the row

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.