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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:54:06+00:00 2026-05-20T09:54:06+00:00

I have a table like this: <table id=myTable cellspacing=0 cellpadding=10 border=0 width=100%> <tbody> ….

  • 0

I have a table like this:

<table id="myTable" cellspacing="0" cellpadding="10" border="0" width="100%">
<tbody>
....
<tr style="color: blue;" id="bankRecord377">      
  <td align="center" class="styleOdd"> <input type="checkbox" value="377" name="377"></td>
  <td align="center" class="styleOdd">377</td>
  <td align="center" class="styleOdd"></td>
  <td align="center" class="styleOdd">391</td>
</tr>
....
<tr style="color: blue;" id="bankRecord386">     
  <td align="center" class="styleEven"> <input type="checkbox" value="386" name="386"></td>
  <td align="center" class="styleEven">386</td>
  <td align="center" class="styleEven"></td>
  <td align="center" class="styleEven">396</td>
</tr>
...
<tr style="color: blue;" id="bankRecord322">     
  <td align="center" class="styleEven"> <input type="checkbox" value="322" name="386"></td>
  <td align="center" class="styleEven">322</td>
  <td align="center" class="styleEven"></td>
  <td align="center" class="styleEven">314</td>
</tr>
...
</tbody>
</table>

I have some input fields and user inserts some information there. After that, I want to dynamically add a tr to the top of my table. I mean I want to generate that:

<tr style="color: blue;" id="bankRecord310">     
  <td align="center" class="styleEven"> <input type="checkbox" value="310" name="386"></td>
  <td align="center" class="styleEven">318</td>
  <td align="center" class="styleEven"></td>
  <td align="center" class="styleEven">314</td>
</tr>

with information of 310(is unique for td 1 and td 2), 318 and 314. You can set ids for tds.

How can I generate dynamiacally a table row with it’s tds that I will set the name, value and etc. attributes?

  • 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-20T09:54:07+00:00Added an answer on May 20, 2026 at 9:54 am

    I made an answer to you problem here:
    http://jsfiddle.net/wEVbU/

    you can add on to that function to do whatever you want to whatever table

    here is the whole function that is there:

    function addTR(id, name, value1, value2, value3, className) {
        $td = $("<td>", {
            style: "text-align: center",
            class: className
        })
        $tr = $("<tr>", {
            style: "color: blue;",
            id: id
        })
        $tr.append($td);
        $tr.append($td.clone());
        $tr.append($td.clone());
        $tr.append($td.clone());
        $($tr.children()[0]).append($("<input>", {
            type: "checkbox",
            value: value1,
            name: name
        }))
        $($tr.children()[1]).html(value2)
        $($tr.children()[3]).html(value3)
        $('#myTable').prepend($tr);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this: <table> <tfoot> <tr><td>footer</td></tr> </tfoot> <tbody> <tr><td>Body 1</td></tr> <tr><td>Body
I have a table like this (Oracle, 10) Account Bookdate Amount 1 20080101 100
In MSSQL I have a table created like this: CREATE TABLE [mytable] (fkid int
I have a table like this: <table id=myTable> <tr><td>1sta</td><td>2nd</td></tr> <tr><td>1stb</td><td>2nd</td></tr> <tr><td>1stc</td><td>2nd</td></tr> <tr><td>1std</td><td>2nd</td></tr> </table> Using
Imagine I have table like this: id:Product:shop_id 1:Basketball:41 2:Football:41 3:Rocket:45 4:Car:86 5:Plane:86 Now, this
If I have a table like this: CREATE TABLE sizes ( name ENUM('small', 'medium',
Let's say I have a table like this: name | score_a | score_b -----+---------+--------
I have a database table like this: id version_id field1 field2 1 1 texta
In MS Transact SQL, let's say I have a table (Orders) like this: Order
I have a relation mapping table like this: attributeid bigint productid bigint To clean

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.