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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:52:20+00:00 2026-06-01T11:52:20+00:00

I have a table. see my table structure <table width=100% border=1> <tr> <td width=2%><h2>#

  • 0

I have a table. see my table structure

<table width="100%" border="1">
  <tr>
    <td width="2%"><h2># SL NO</h2></td>
    <td width="70%"><h2>Name</h2></td>
    <td width="15%"><h2>Edit</h2></td>
    <td width="13%"><h2>Delete</h2></td>
  </tr>


  <tr id="id0">
    <td >1</td>
    <td>XXXXXXX</td>
        <td><a href="#"><img src="../images/icon_edit.gif" alt="Edit" /></a></td>
    <td width="13%"><a href="#"><img src="../images/delete_07.png" alt="Delete"  onclick="fnDeleteState(0)" /></a></td>
  </tr>
  <tr id="id1">
    <td>2</td>
     <td>XXXXXXX</td>
    <td><a href="#"><img src="../images/icon_edit.gif" alt="Edit" /></a></td>
    <td%"><a href="#"><img src="../images/delete_07.png" alt="Delete"  onclick="fnDeleteState(1)" /></a></td>
  </tr>

…
….
..

When press on the delete button i need to hide that row I have used this to remove particular row from the table

$("#id" + i).remove();

Its working fine. But the serial number… i’s display as wrong. I.e. when I delete second row the serial number with in the third row is still 3 I need to display this s 2 and so on…

I there is any way to do this in jquery
Thanks in advance

  • 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-01T11:52:21+00:00Added an answer on June 1, 2026 at 11:52 am
    function fnDeleteState(i) {
        $("#id" + i).remove();
        $("tr").each(function (index) { // traverse through all the rows
            if(index != 0) { // if the row is not the heading one
                $(this).find("td:first").html(index + ""); // set the index number in the first 'td' of the row
            }
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for a pretty specific question. I have a table (see bottom), and when
I have a table defined (see code snippet below). How can I add a
I have an application that has a status table see Database best practices -
I have table with 50 entries (users with such details like Name Surname Location
Basically I'm creating this website and I have the wrapper set to 100% width
I have a table structure like below : categoryID bigint , primary key ,
I have a table with the following structure: ID | Color 1 | red
I have a table with the following structure: WorkerPersons ------------------------------- ID (PK) PersonID (Indicates
I have a table with a current structure as follows: Currently this is populated
I have a table in PostgreSQL with the following structure & data: Question |

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.