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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:17:40+00:00 2026-06-05T13:17:40+00:00

I created a table, on referring http://stackoverflow.com/questions/9045940/dynamically-adding-table-row , whenever i came into the last

  • 0

I created a table, on referring “http://stackoverflow.com/questions/9045940/dynamically-adding-table-row” , whenever i came into the last row in the table i need to add another row into the table at the bottom dynamically, here is the code i tried:

<table id="myTable" style="table-layout:auto">

   <tr>
   <td><input type="text" onblur="addRow('myTable')" /></td>
    <td><input type="text"/></td>
    <td><input type="text"/></td>
  </tr>

</table>

and the javascript is as follows:

<script>
function addRow()
{
   //add a row to the rows collection and get a reference to the newly added row
   var newRow = document.all("myTable").insertRow();

   var oCell = newRow.insertCell();
   oCell.innerHTML = "<input type='text' onblur='addRow();'>";

   oCell = newRow.insertCell();
   oCell.innerHTML = "<input type='text' name='title'>";

   oCell = newRow.insertCell();
   oCell.innerHTML = "<input type='text' name='title'>";   
}

</script>

But, here a new row is added at the top of the table, what should i do?

  • 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-05T13:17:42+00:00Added an answer on June 5, 2026 at 1:17 pm

    change var newRow = document.all("myTable").insertRow();

    to

    var newRow = document.all("myTable").insertRow(-1);

    Also, in your onblur event, why do you pass an argument to the addRow function when it doesn’t take any?

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

Sidebar

Related Questions

I have a dynamically created table which in the last <td> there is a
I am referring to http://www.if-not-true-then-false.com/2009/11/howto-create-postgresql-table-partitioning-part-1/ To reproduce the problem, here is some simple steps
I'm trying to create a page which looks somewhat like this: http://www.drmichaelbogdan.com/plastic-surgery/ (I'm referring
I created a table without a primary key Like this: private static final String
I created a table then added a foreign key reference to its primary key
I created a table tbl_Candidate , but I forgot to set the primary key
I have created one table using the below command: create table Table1( Id int
I accidentaly created a table in PostgreSQL which contains, in its name, some double
We have created a table with a trigger that updates a ModifiedDate field in
I have Created a table like CREATE TABLE [dbo].[tab1]( [Id] [int] NOT NULL, [Name]

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.