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

  • SEARCH
  • Home
  • 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 8044771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:19:52+00:00 2026-06-05T05:19:52+00:00

<table border=2> <tr><td>one</td><td>two</td></tr> <tr><td>one</td><td>two</td></tr> <tr><td colspan=2 id=new >add new</td></tr> </table> $(‘#new’).click(function(){ $(‘#new’).append(<tr><td>one</td><td>two</td></tr>); }) Now

  • 0
<table border="2">
    <tr><td>one</td><td>two</td></tr>
    <tr><td>one</td><td>two</td></tr>
    <tr><td colspan="2" id="new" >add new</td></tr>
</table>

$('#new').click(function(){
   $('#new').append("<tr><td>one</td><td>two</td></tr>");
})

Now if i click “add new” then this make:

one | two
one | two
add new
one  two

How can i make:

one | two
one | two
one | two
add new

LIVE: http://jsfiddle.net/tg5qD/

  • 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-05T05:19:54+00:00Added an answer on June 5, 2026 at 5:19 am

    demo http://jsfiddle.net/eDNH5/2/

    Another Working Demo http://jsfiddle.net/eDNH5/5/

    API: http://api.jquery.com/before/

    Updated another way

    $('#new').click(function(){
        $('table tr:last').before('<tr><td>one</td><td>two</td></tr>');
    })​
    

    code

    $('#new').click(function(){
       $('#new').parent().before("<tr><td>one</td><td>two</td></tr>");
    })​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have: <table> <tr><td has=one>test</td><td has=three>test</td></tr> <tr><td has=two>test</td><td has=four>test</td></tr> </table> table td { border:
I have two different style definitions for tables: table { border: solid 1px #E8EEF4;
I want to add a border radius around the entire table. But the following
This is a HTML email. I have two tables inside each other. One set
<table border=1 width=600 align=center> <tr> <td colspan=2 align=right>date</td> </tr> <tr> <td width=10%>avatar</td> //cant balance
I have an issue with a table containing three cells in one row. Two
I have a table of one row with two columns.I want to align content
JsFiddle DEMO Here's my html: <span> Testing <table> <tbody> <tr> <td>One</td> <td>Two</td> <td>Three</td> </tr>
I am using a two-column HTML table to display a list of rules. One
In my html page, I have one table, for every row there are two

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.