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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:57:49+00:00 2026-06-06T06:57:49+00:00

<table class=privilage> <caption> These are the default users for institution </caption> <thead> <tr> <th>Users

  • 0
<table class="privilage">
                <caption> These are the default users for institution </caption>
                <thead>
                    <tr>
                        <th>Users Name</th>
                        <th>User Id</th>
                        <th>Password</th>
                   </tr>
                </thead>
                <tbody>
                         <tr>
                            <td><input type="text" name='DefaultUser[]' value='' ><br></td>
                            <td><input type="text" name='DefaultUser_UserName[]' value=''></td>
                            <td><input type="password" name='DefaultUser_Password[]'></td>
                        </tr>


                <div id="New_User"></div>
                </tbody>
  </table> <table>
                    <tr>
                        <td><input type="button"   name="Add_New_User" value="Add new User" onclick="addRow()"></td>
                    </tr>
                </table>

The above HTML have a div named New_User, I asked the below javascript to print ussing innerHTML to that div, but it prints out elsewhere.

 function addRow()
 {
var d= document.getElementById("New_User");
d.innerHTML+="<tr><th><input type='text' name='DefaultUsers' value=''/> Manager<br></th><th><input type='text' name='UserName' value=''/></th><th><input type='password' name='Password'/></th></tr>";
}​

I just need to add those new row to the ‘privilage’ table.
Any Consideration and help are welcome.
Thanks in Advance.

Jsfiddle code

  • 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-06T06:57:50+00:00Added an answer on June 6, 2026 at 6:57 am

    You can actually add new rows to your table without an extra Div inside it. You can use JS in-house functions to achieve this.
    Also Please remove <div id="New_User"></div> from your tbody, This makes your DOM structure invalid.

    Do this, Working demo : http://jsfiddle.net/epinapala/QPY6b/5/,

    Add a new attribute id=”tableID” to your table though!

    function addRow() {
                var tableID = "tableID";
                var table = document.getElementById(tableID);
    
                var rowCount = table.rows.length;
                var row = table.insertRow(rowCount);
    
                var cell1 = row.insertCell(0);
                var element1 = document.createElement("input");
                element1.type = "text";
                cell1.appendChild(element1);
    
                var cell2 = row.insertCell(1);
                var element2 = document.createElement("input");
                element2.type = "text";
                cell2.appendChild(element2);
    
                var cell3 = row.insertCell(2);
                var element3 = document.createElement("input");
                element3.type = "text";
                cell3.appendChild(element3);
    
    
            }
    

    ​

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

Sidebar

Related Questions

I have a table called Users ( class User < ActiveRecord::Base ) and a
In my table: <table class =test> <tr class=bill> <td class=total-title>Totals</td> <td> <input class=Test1 type=text
I'm trying to follow table and class name conventions, but I am not sure
what will be the regular expression for a table with class name tn_result ?
For the Table class in user guide, it mention how to generate a table
I have this class called Table: class Table { public string Name { get
My Table structure is like follows: <table> <thead> <tr class=navigation> </tr> </thead> <thead> <tr
I have the following table: Class, Name, Score 1, Anna, 34 1, Andy, 80
I have a many-to-many association between a User class and a Table class. Additionally,
I had a simple table: class test(Base): __tablename__ = 'test' id = Column(Integer, primary_key=True)

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.