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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:03:46+00:00 2026-06-13T20:03:46+00:00

I have a table that is filled in with values dependant on a previous

  • 0

I have a table that is filled in with values dependant on a previous page
those avlues are filled in with struts apparently

but I’m not very good with all that stuff so is there a simple was I can do something like this, either with HTML only or maybe a small javascript I can put in tha page?

<Table>
<TR>
<TH>ID</TH>
<TD><s:property value="groupID" /><TD> <--Number generated by the page with struts
</TR>
<TR>
<TH>ID Value</TH>
<TD>foobar</TD> <-- the text I want to add in dependant on the number from the previous TD
</TH>
</Table>

so, is there a simple way to go about doing this? HTML, CSS, JavaScript solution maybe?

  • 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-13T20:03:47+00:00Added an answer on June 13, 2026 at 8:03 pm

    Given that exact HTML, a simple script like this will do it. But if you don’t know JavaScript, you should really learn it so that you understand what you’re doing.

    <body>
        <Table>
            <TR>
                <TH>ID</TH>
                <TD><s:property value="groupID" /><TD>
            </TR>
            <TR>
                <TH>ID Value</TH>
                <TD>foobar</TD>
            </TR>
        </Table>
           <!-- The script is here so it won't run until the TABLE has loaded -->
        <script type="text/javascript">
    
              // This is a map of the struts values to your values
            var valueMap = {
                "1": "foo",
                "2": "bar",
                "3": "baz"
            };
              // Browser compatibility. Older IE uses 'innerText' instead of 'textContent'
            var textContent = ('textContent' in document) ? 'textContent' : 'innerText';
    
              // Get all the TD elements on the page
            var tds = document.getElementsByTagName('td');
    
              // Get the text content of the first TD (index 0)
            var text = tds[0][textContent];
    
              // Get the value from the map using the text we fetched above
            var value = valueMap[text];
    
              // Set the text content of the second TD (index 1) to the mapped value
            tds[1][textContent] = value;
        </script>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table cell that isn't entirely filled with text so the bg
I have a listbox that is dynamically filled by certain values depending on what
I have a html table which if filled by values of an mysql table.
I have table column filled with float values e.g.: id-Values 1- 0.19230769230769232 2- 8.4848484848484854E
I have a table in my JSP that can, when the page is generated
Let's say I have a dynamically-created table that is filled with data from a
I have an array that is filled with values dynamically and I have to
I have table that I insert data with following query (from c# code): INSERT
I have table that contain date and time field. id|date|time ========= 1|01/01/2001|10:45 2|01/02/2002|11:45 3|01/03/2003|12:45
I have a table that contains multiple dropdown menus for a list of profile

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.