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

The Archive Base Latest Questions

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

I have successfully worked with jQuery DataTables and they look and function great. But

  • 0

I have successfully worked with jQuery DataTables and they look and function great. But I’m switching to adding rows dynamically and some of the formatting disappears when the rows are added.

1.The background colors of the columns disappear
2. the selected clumn background color disappears as well
3. and if you click on the column headers it kills all the rows and resets the DataTable to its initial state with all the background colors and select column background back as they should be.

This is how the table is initialized”

oTable = $('.utable').dataTable( {"sDom": 'rt',"sScrollY":"260px", "bPaginate":false, "bFilter":false, "bInfo": false});

Here is how I add the new rows:

document.getElementById('tbdy').innerHTML="<tr id='zrow16' class='gradeX'><td id='d1'>None</td><td id='d5' class='ralign'>None</td><td id='d6' class='ralign'>None</td></tr>";...<tr id='zrow17' class='gradeX'><td.... "
  • 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-31T19:19:57+00:00Added an answer on May 31, 2026 at 7:19 pm

    To add row you should use fnAddData(), you shouldn’t append a <tr> otherwise you break the table

    var giCount = 2;
    function fnClickAddRow() {
      oTable.fnAddData( [
        giCount+".1",
        giCount+".2",
        giCount+".3",
        giCount+".4",
       '<input type="checkbox">']
      );
    
      giCount++;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just starting to learn Python, but I have already run into some
I have experienced a weird problem with javascript. The problem page uses some jQuery
I have recently used the Asual Jquery Address v.1.3 and it workes successfully with
I have finally successfully created and worked in a branch. I have commited my
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
I have successfully managed to get System.Speech.Synthesis to read English text in arbitrary voices
I have successfully implemented interop beftween Win32 application and managed .Net dll as described
I have successfully upgraded an MFC application which was compiled with an old version
I have successfully used the Excel and Word addin templates in Visual studio 2008
I have successfully set up FILESTREAM on my SQL 2008 server; however I've noticed

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.