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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:28:36+00:00 2026-06-10T11:28:36+00:00

I added rows to a html table with jQuery, but when I refresh the

  • 0

I added rows to a html table with jQuery, but when I refresh the browser, the rows disappear. How can I get the rows to stay?

<TABLE id="dataTable" width="100%" align="center">
    <TR align="center" border="1">
        <TH></TH>
        <TH>ID </TH>
        <TH>Name</TH>
        <TH>Status</TH>
    </TR>
    <TR align="center">
        <TD><INPUT type="checkbox" name="chk"/></TD>
        <TD> 1 </TD>
        <TD> <INPUT type="text" value="Submission 1" /> </TD>
        <TD>Working version</TD>
    </TR>
</TABLE>

<script type="text/javascript">

$(document).ready(function(){
$('#createNew').click(function() {
    var table = document.getElementById('dataTable');

    var rowCount = table.rows.length;

    $('#dataTable tr:last').after('<TR align="center"><TD><INPUT type="checkbox" name="chk"/></TD><TD>'+ rowCount + '</TD><TD> <INPUT type="text" value="Submission 1" />   </TD><TD>Working version</TD></TR>');
  • 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-10T11:28:37+00:00Added an answer on June 10, 2026 at 11:28 am

    This is just a suggestion, but You can try to store Your new rows in cookie, like shown here:
    how to store an array in jquery cookie?

    This way after page refresh You will get Your rows back (of course You need to read cookie and add rows when page is loaded again).

    But the best solution would be to use server-side code to store new rows into database and load them every time You refresh page, this way new records will be visible for everyone who will access that page (or only for specific user if You’ll add user identification, but that’s bit off Your question).

    Check article from @Kell answer, this is really easy to implement 🙂

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

Sidebar

Related Questions

How can I count the table rows that is added dynamically with jQuery? I
I dynamically added rows to a table but it doesn't seem to take hover
I have a table like below and its rows can be added and removed
I have a table. Some rows are dynamically added by jquery. The first <td>
I'm using jQuery to dynamically add rows to my HTML table on a button
I have an html table with a few rows, I have included a jquery
I was looking at adding rows dynamically to my HTML table using jQuery with
I have a table where the rows are dynamically removed and added via jQuery.
I have a HTML table that displays rows of records and has a column
I'm attempting to make a table that has header rows that can be collapsed

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.