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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:26:13+00:00 2026-05-25T01:26:13+00:00

I have the following table format and would like to be able to add

  • 0

I have the following table format and would like to be able to add new columns and new rows based on user inputs.

The clickable part of the document basically consists of a list of names that will be the far left item of each row. Additionally there is a second clickable area that should add elements horizontally to each row adding a table header as it adds a new column.

For example:

List of names:
[Jeff] [bill] [fred] [jake]

List of items to be added to each column:
[apples] [oranges] [cars] [shoes]

If Jeff and bill were selected and apples and oranges were selected the table should be updated to look as such.

[Name] [apples] [oranges]
[jeff] [      ] [       ]
[bill] [      ] [       ]

If then another item was selected it would look as such

[Name] [apples] [oranges] [shoes]
[jeff] [      ] [       ] [     ]
[bill] [      ] [       ] [     ]

Additionally if another name was selected at this point it should look as such

[Name] [apples] [oranges] [shoes]
[jeff] [      ] [       ] [     ]
[bill] [      ] [       ] [     ]
[fred] [      ] [       ] [     ]

This is what the html structure looks like:

<form>
    <div id="opTable"> 
        <div class="thead">
            <div class="th first">
                Name
            </div>
            <div class="th">
                clase
            </div>
            <div class="th">
                gold
            </div>
        </div>
        <div class="tbody"> 
            <div class="tr"> 
                <div class="td first">
                    Billy
                </div>
                <div class="td">
                    <input type="text" style="width:100px"/>
                </div>
                <div class="td">
                    <input type="text" style="width:100px"/>
                </div>
            </div>
        </div>
    </div>
</form>

Additionally, the code should be able to remove a name and or item in the same ways. I hope my question is clear enough.

  • 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-25T01:26:13+00:00Added an answer on May 25, 2026 at 1:26 am

    If what you want to display clearly is a table, then I would suggest to also use a table for the markup.

    This will also make rendering the markup as a table a lot easier 🙂 By using a table, displaying the columns next to each other will be an inherent feature. No CSS trickery needed.

    Adding another row will become (I use DOM API here because it’s more performant than appending strings if your table gets large)

    //Assuming each row has the same nr of columns
    var numcols = $('#opTable tr:eq(0) td').length;
    var row = document.createElement('tr');
    
    //Insert name
    var name_td = document.createElement('td');
    row.appendChild(name_td);
    name_td.appendChild(document.createTextNode(name));
    
    //fill the rest with empty td's
    for (var i=1; i < numcols; i++) {
        row.appendChild(document.createElement('td'));
    }
    
    $('#opTable').append(row);
    

    Adding a column means doing something very similar, the difference is just that you append a <td> to each <tr>:

    $('#opTable').find('tr').each(function(i) {
        if (i == 0) {
           $(this).append('<td>' + item + '</td>');  
        }
        else {
            $(this).append('<td/>');
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like suggestions how to solve the following demand. I have a table
I have a php query the returns the following JSON format from a table.
I have a table named People in the following format: Date | Name .
I have a page which contains several tables, and I would like to format
I have a table of data which I would like to order by the
I have the following code which formats a table on a webpage like this:
I have a web form which has dynamic table using repeating rows. New rows
I have three tables... Given the following tables I would like to know how
I'm new to MVC and would like to add a link to something like
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party

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.