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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:40:45+00:00 2026-05-12T18:40:45+00:00

I am using Displaytag to display the DataGrid. Now, I have to change the

  • 0

I am using Displaytag to display the DataGrid. Now, I have to change the color of rows based on some calculation. Like if

the value of column3 + column4 > coulmn5 then the row color should be yellow

value of column3 + column4 < coulmn5 then the row color should be red

value of column3 + column4 = coulmn5 then the row color should be white

I think the only way to do this is by using getElementByID() method

Note: i don’t want to consider the solution using getElementsByTagName()[index] , reason being later on the column ordering might change.

at present i am using the following code, which i want to change.

var rows = tbody.getElementsByTagName("tr");

Iterate the rows Object

var tdObj = rows[i].getElementsByTagName("td")[3]  
  • 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-12T18:40:45+00:00Added an answer on May 12, 2026 at 6:40 pm

    First, I do not believe it is possible to set the ids on the td’s or tr’s in displaytag without modifying the source. This has not left my list of things to do, but for now I have a work around for you.

    Instead of defining your table:

    <display:table id='row' name="..." export="true" requestURI="">
      <display:column property="usefulData" title="Useful data" sortable="true" />
      ... more columns ...
    </display:table>
    

    do this:

    <display:table id='row' name="..." export="true" requestURI="">
      <display:column title="Useful data" sortable="true" >
        <span id='${row.usefulData}' class='css_class_selector'>${row.usefulData}</span>
      </display:column>
    </display:table>
    

    Note the span wrapping the printed data. Now you can select the data relating printing inside your table, which is probably what you want; to select your data, as opposed to specifically selecting the td’s and tr’s.

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

Sidebar

Related Questions

I have knowledge on how to customize the display data using Struts2 displaytag:table and
I am currently using displaytag for tabular data, but would like to create a
Using VB.NET Using DatagridView, In a Datagrid View values are displaying like this ID
I'm in the midst of converting some tables that are using DisplayTag over to
I'm using a display:table , just to display tags. In my scenario I have
I am using DisplayTag 1.2 and I have a problem when I try to
I am getting the value of amount like 4567.00 , 8976.00 etc. Now while
I have been using Freemarker for a while and found displaytag library very useful.
I am using Visual Studio 2008 with .NET Framework 3.5. I have a DataGrid
I have a table, using display tag, in my application, that is using spring

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.