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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:19:32+00:00 2026-05-31T05:19:32+00:00

I have an issue when I remove rows from a table. This is the

  • 0

I have an issue when I remove rows from a table.
This is the JS code I use, if it is of any help.

function rem(el) {
    while (el.nodeName !== "TR") {
        el = el.parentNode;
    }
    el.parentNode.removeChild(el);
}  

The table is built like this:

<tr>
  <td>
    <span onclick="rem(this);"></span>
  </td>
</tr>  

The issue occurs when the table exceeds the browser’s height and the scrollbar appears.

  • If the scrollbar is at the top and I remove a row, the remaining rows
    will flow up.

  • If the scrollbar is at the bottom and I remove a row, the remaining rows
    will flow down.

  • But if the scrollbar is in the middle of a table and I remove a row,
    the remaining rows will flow up until the scrollbar hits the bottom
    of the screen. Then the rows will start to flow down. I would like
    the table to either flow up or down. It doesn’t matter
    which way as long as it stays consistent.

Since I remove a row by clicking on it, the table flow has to stay consistent. If the remaining rows move in different ways it’s difficult for the user to predict which the next row will be, the one above or the one below.

My question is of course “How can I set in which way the remaining rows will flow after the deletion of a row?”

Let me know if I need to explain the issue further.

  • 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-31T05:19:33+00:00Added an answer on May 31, 2026 at 5:19 am

    this is natural behavior since:

    • if you are up top (scrollbar at the top), you remove an element and the rows shift up.

    • if you are down at the bottom (scrollbar at the bottom), if you remove the element, ofcourse you are going to go upwards (since there is nothing to go to)

    • if you are in the middle, it naturally removes elements and shifts stuff up (as with case 1) and if you have noting more to shift up, case 2 applies.

    now, if your issue is just to tell the user which row was next after you deleted an item, i suggest you use a color-coded row scheme (additionally, show an id for the item, like say task ID for a task)

    also, so as not to harass the user with many data and didn’t know what was next, i suggest you employ something like a fade-remove or slideup-remove so the removal process is not abrupt (and the user can figure out that something is removed and took it’s place). jQueryUI has a lot of these removal effects.

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

Sidebar

Related Questions

I have an issue with using AWK to simply remove a field from a
I currently have code similar to this for a form: $('#some-form') .submit(function() { //
I'm have little problem in retrieving the data from a table here's the code:
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We have an issue using the PEAR libraries on Windows from PHP . Pear
I'm doing a dynamic table to collect passengers personal data. This table have above
I have click handlers I want to apply to the rows in my table:
I have an html table with rows, in one of the cells I want
I erroneously delete all the rows from a MS SQL 2000 table that is
I Have Table with multiple columns and rows, Example, <table> <thead> <tr> <th>Head 1</th>

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.