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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:05:38+00:00 2026-05-27T13:05:38+00:00

I followed the question previously posted here I need to do pretty much same,

  • 0

I followed the question previously posted here

I need to do pretty much same, i.e. I have an add button on each row and on add image click I want to move that row to another table, except that when I move my row, the target table has only one column common to the source table (source table has one more extra column which I dont have in the target table) and I need to add a column with a delete button image for every row moved into the target table.
Right now able to delete the row from the source using the following code:

$(document).ready(function () {
    $('#table_source td img.move_row').click(function () {
        $(this).parent().parent().parent().remove();
    });
});

Second part needed is when I click the delete image button in the target table the row should move back to the original table

Thanks in advance,

Priyank

  • 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-05-27T13:05:38+00:00Added an answer on May 27, 2026 at 1:05 pm

    HTML

    <table id="table_source">
        <tbody>
            <tr>
                <td>Row</td>
                <td>1</td>
                <td><img src='move_image_path' alt='Move' class='move-row' /></td>
            </tr>
            <tr>
                <td>Another Row</td>
                <td>2</td>
                <td><img src='move_image_path' alt='Move' class='move-row' /></td>
            </tr>
        </tbody>
    </table>
    
    <table id="table_dest">
        <tbody>
        </tbody>
    </table>
    

    JS

    $(document).ready(function() {
        $("#table_source img.move-row").live("click", function() {
            var tr = $(this).closest("tr").remove().clone();
            tr.find("img.move-row")
                .attr("src", "remove_image_path.jpg")
                .attr("alt", "Remove");
            $("#table_dest tbody").append(tr);
        });
    
        $("#table_dest img.move-row").live("click", function() {
            var tr = $(this).closest("tr").remove().clone();
            tr.find("img.move-row")
                .attr("src", "move_image_path.jpg")
                .attr("alt", "Move");
            $("#table_source tbody").append(tr);
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed this question stuck on changing each row color during run-time in listview
I followed the question here Quaternion math for rotation? to get an angle of
I have followed the suggestion in this question... [ How to handle checkboxes in
I have followed the suggestion in this question as I am using Django, I
After this question , I need to know what principles should be followed in
Followed this question about delayed_job and monit Its working on my development machine. But
Question regarding how to setup dbase relationships (newbie, this may be trivial) Followed the
This is a follow up to the question asked here: Groovy parsing text file
Simple question, I guess. For a long time I've blindly followed a (supposedly) common
my first question sorry if this is too basic. I followed the tutorial Beginning

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.