Alternate row color?

hi all,
I would like to know how to make all the rows in a table have alternate color just like the forum message board as we it (i.e white and purple).In fact i am retrieving the data from a Db and displaying it in a table.
Please help.

This code you have is going through a result set and adding the acronyms to a list.
The bit to deal with alternating colours would be the bit where you iterate through the list, and output <tr><td> tags in a table.
Easiest way is to use a JSTL forEach loop and css styles
<head>
  <style>
    tr.line1style{background-color:blue}
    tr.line2style{background-color:red}
  </style>
</head>
<table>
<tr>
  <th>ACRONYM</th>
  <th>DEFINITION</th>
</tr>
<c:forEach var="acronym" items="${acronymlist}" varStatus="status">
<tr class="${status.index%2==0 ? 'line1Style' : 'line2Style'}">
  <td><c:out value="${acronym.acronym}"/></td>
  <td><c:out value="${acronym.definition}"/></td>
</tr>
</c:forEach>
</table>

Similar Messages

  • Is there a Terminal command to set alternate row colors in Mail?

    I'd like to enable the alternate row colors in the message list, but the only way I can find to do it requires Developer tools to be installed.
    Not bad for my Mac, but it seems a bit of a workload for the other 19 Macs in the office. There's nothing in Onyx or Secrets that'll do this.
    Here's what I found on the web: http://pjkh.com/articles/2007/10/08/alternating-row-colors-in-apple-mail
    There's a plug-in called WideMail which I'm using but it doesn't seem 100% stable.
    Thanks

    Just do the hack once and copy that version of the Mail.app application (or just the MessageViewerContents.nib file) to the other machines. Just make sure that they are running exactly the same version of Mail and MacOS X. This hack will probably not work in Snow Leopard, by the way.

  • Setting alternate row color of DataGridColumn

    Is there a way to set alternate row color of a
    DataGridColumn? I need to set different alternating row color to
    different DataGridColumn.

    Please Check this example
    http://www.flex4ex.com/?p=9

  • GROUP attribute ruins alternate row coloring

    I had the alternate row colors working, but then when I added
    the "GROUP" attribute to my
    <cfoutput> tag, it's not working any more. More like
    random row coloring!
    Any thoughts?
    Thanks!
    Rick
    <table width="100%" border="1" cellspacing="0"
    cellpadding="0">
    <cfoutput query="q_reqmnts_f3" group="req_Cat">
    <tr bgcolor="###iif(currentrow MOD
    2,DE('c5c7c9'),DE('9dc7fc'))#">
    <td height="12"><font
    size="3"><strong>#req_Cat#</strong><br></font>
    <font size="3"><cfoutput>
    <li>     <strong>#req#</strong>   #Spec1#  #Spec2#  <a
    href="
    http://#Link#">#Link#</a> <br
    style="empty-cells:hide"></li></cfoutput><br>
    </td>
    </tr>
    </cfoutput>
    </table>

    when you use the GROUP attribute of CFOUTPUT, your data is no
    longer being output in the same order in which it was retrieved.
    the CURRENTROW variable is no longer in chronological order (you're
    displaying the first grouped element, then 1-n members of that
    group, then repeating).
    you'd need to set an iterating variable.
    <cfset myRowCountVar = 0 />
    <cfoutput query="q_remnts_f3" group="req_Cat">
    <cfset myRowCountVar = myRowCountVar + 1 />
    (now use 'myRowCountVar' to key off of to determine the
    background color rather than currentrow)

  • How to create a Listbox in UI5 with alternate row color for the Listitems.

    Hi,
    I need to create a Listbox for browser (not mobile). But not getting any properties for alternate row color for the list items.
    If anyone worked on this pls share.
    Thanks,
    Nigam

    Hi Guys
    Chandra's solution is sweet.
    Here is another one so that it will not affect the other lists (if any) that you do not want alternate colors.
    -D

  • Scroll bar and alternate row color in Trinidad table

    I am using Jdeveloper 11g
    I have two question on tinidad table see below sample code
    *1)How to set scroll bar on table*
    *2)how to set different colors for alternate rows*
    <tr:form>
    <tr:panelGroupLayout>
    <tr:panelFormLayout inlineStyle="width:965px; height:512px; margin:50px;">
    <f:facet name="footer">
    <tr:table value="#{bindings.UserFavoriteVO.collectionModel}"
    var="row" rows="#{bindings.UserFavoriteVO.rangeSize}"
    binding="#{UserActionBean.table1}"
    emptyText="#{bindings.UserFavoriteVO.viewable ? 'No rows yet.' : 'Access Denied.'}"
    rowSelection="multiple" id="table"
    inlineStyle="border-width:none; outline-color:ActiveCaption; outline-style:groove; border-color:Navy; color:MenuText; font-size:medium;"
    horizontalGridVisible="true" verticalGridVisible="false">
    Thanks for all help
    Jaydeep

    Hi Sireesha,
    Thanks for reply.
    I forgot to mentioned that i already tried that option *(rowBandingInterval)*
    <tr:table value="#{bindings.UserFavoriteVO.collectionModel}"
    var="row" rows="#{bindings.UserFavoriteVO.rangeSize}"
    binding="#{UserActionBean.table1}"
    emptyText="#{bindings.UserFavoriteVO.viewable ? 'No rows yet.' : 'Access Denied.'}"
    rowSelection="multiple" id="table"
    inlineStyle="border-width:none; outline-color:ActiveCaption; outline-style:groove; border-color:Navy; color:MenuText; font-size:medium;"
    horizontalGridVisible="true" verticalGridVisible="false"
    rowBandingInterval="1">
    but no any success.
    *@ scroll* I found in Frank post it is related to ADF table .So i just want to ask will it be applicable to Trinidad table too.

  • Alternate row color urgent

    Hi I have to make alternate color rows.
    now possible solution is below but it is giving one extra line below table.so i dont want to use this.
    is there any idea
    thanxs<%
    int num = 0;
    String SLATE = "#E4E4E4";
    String WHITE = "#FFFFFF";
    String bgColor = null;
    %>
    <logic:iterate id="element" name="dateMap">
    <%
    num++;
    if((num % 2) == 0) {
    bgColor = SLATE;
    } else {
    bgColor = WHITE;
    %>

    That's odd. When I select alternating row color in the Table Inspector I get alternating row colors in the entire table. Is your spreadsheet based on the Blank template?

  • My song lists used to alternate row colors but now they're all white... How do I undo this ?

    I do not know how this problem began.  All I know is that in a guest account, the colors of the rows alternate between white and blue.  But now the background is completely white.  However, if a webpage or another window overlaps the iTunes page, immediately off the edge of the overlapping page you can see the alteration of colors just a little bit.

    This was driving me crazy too, after some digging around here in the forums I found the problem.
    Go to System Preferences
    Click on Accessibility
    Under Display, move the slider labeled "Enhance Contrast" all the way to the left (Normal)
    You should now have alternating row colors back!

  • Alternate row color for table question

    I'm alternating the row color on a table, and if I have a
    <a href> in
    the table, the background behind the <a href> isn't the
    same as the row
    color based on:
    <tr bgcolor="###iif(currentrow mod
    2,de('ffffff'),de('efefef'))#">
    Is there a way to have the CSS that formats the <a
    href> change at the
    same time as the background color for the row??

    How about a way to do it without having to learn something
    else (like a
    framework??)
    Anyone done something like what I'm looking to do? Just
    change the <a href>
    formatting to go along with the inline iif shown below?
    <tr bgcolor="###iif(currentrow mod
    2,de('ffffff'),de('efefef'))#">
    Steve
    "Daverms" <[email protected]> wrote in
    message
    news:fgn5vi$83b$[email protected]..
    > Hi,
    >
    > Try implementing the "JQuery" framework in your
    application. It really
    > minimizes the coding time and enables you to concentrate
    on development
    > alone.
    >
    > (Try Googling, You can find more JQuery solutions for
    this TR alternative
    > bgcolor issues, ).
    >
    >
    >
    >

  • How to display alternate row colors in struts form?

    hi,
    I am using struts lib to display data in jsp page.
    <logic:iterate id="result" name="listofPorjetcts" indexId = "i">
    <tr>
    <td ><bean:write name="result" property="projectName"/></td>
    </tr>
    how to display alternaternate row colors ?
    any one can help?

    hey i not sure abt structs, what i did for jsp was using a boolean.
    declare boolean red=true;
    <tr
    <%
    if(red){%>
    class="red" >
    <%
    red=false;
    }else{%>
    class="white">
    <%
    red=true;
    %>
    take note that the class is a predefined css. I think u can use style="background-color:#red "
    You can seearch the web for more info.

  • Nimbus' TableCellRenderer for boolean doesn't paint the alternate row color

    Watch for yourself:
    import javax.swing.*;
    import javax.swing.table.*;
    public class BooleanTable implements Runnable {
         public static void main(String[] args) throws Exception {
              for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                   if ("Nimbus".equals(info.getName())) {
                        UIManager.setLookAndFeel(info.getClassName());
                        break;
              SwingUtilities.invokeLater(new BooleanTable());
         @Override
         public void run() {
              JTable table = new JTable(new Model());
              JFrame frame = new JFrame(getClass().getSimpleName());
              frame.add(new JScrollPane(table));
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         static class Model extends AbstractTableModel {
              @Override
              public int getColumnCount() { return 2; }
              @Override
              public String getColumnName(int col) { return getColumnClass(col).getSimpleName(); }
              @Override
              public Class<?> getColumnClass(int col) { return col==0 ? Number.class : Boolean.class; }
              @Override
              public int getRowCount() { return 100; }
              @Override
              public Object getValueAt(int row, int col) { return col==0 ? row : row%3==0; }
    }Feature or Bug?

    clearly a bug - some shitty internal hack-on-a-hack code shooting itself in the knee ;-)
    Fought with it last year, not sure if I documented the dirtier details, though, as my concern was JXTable which potentiated the problems:
    [http://forums.java.net/jive/thread.jspa?messageID=364610&#364610]
    HTH
    Jeanette

  • Alternate row coloring ("zebra") in FRS

    I have a request to create report where every 3rd line in output rows would be underlined (so that users can easier track the line in wide report). My report has only one Row section, with Descendants() function on certain hierarchy (e.g., grants). Report should look something like this:
    grant1     100     100     50
    grant2     150     120     60
    grant3     110     110     90
    grant4     100     100     50
    grant5     150     120     60
    grant6     110     110     90
    grant7     100     100     50
    grant8     150     120     60
    grant9     110     110     90
    How can I achieve this? Can I somehow create column that would display output row numbers, and maybe use that to do conditional formatting?
    Thanks,
    Milos

    UNfortunatelly, nothing in my grid or expanded hierarchy (against which I use DESC()) can be used to determine which expanded member in the outline is the third, sixt, ninth, etc. That is why I was hoping that somone might know the way to create rown number for each expanded line, as there is no straigh-forward way to do so. If I could get a column with those numbers, then I could use it with Conditional Formatting to achieve my goal. This is what I am looking for:
    grant1     100     100     50     1
    grant2     150     120     60     2
    grant3     110     110     90     3
    grant4     100     100     50     4
    grant5     150     120     60     5
    grant6     110     110     90     6
    grant7     100     100     50     7
    grant8     150     120     60     8
    grant9     110     110     90     9

  • Is there a way to alternate row colors in a netui-data:repeater????

    Thanks.

    John--
    This is addressed in this article, though the graphic associated with
    the example is wrong. :)
    http://dev2dev.bea.com/products/wlworkshop81/articles/repeater.jsp
    Hope that helps.
    Eddie
    John Hundley wrote:
    Thanks.

  • Displaying Alternate row as colored in Cross tab

    Hi,
    I have a report where I need to display alternate rows as colored.
    There is some data in detail section followed by a cross tab in the report header section.
    While I am able to display alternate rows as colored in Detail secction for displaying alternate colored rows in Cross tab data I need some help.
    Data in cross tab is like this
                  history geography
    Tammy   90          60
    Sid         80          50
    Julia       70        40
    In cross tab for displaying alternate colored rows ie for alternate student names  I am using two formulas
    - for displaying row values I am using this one
    whileprintingrecords;
    numbervar d;
    d := iif(d=100,255,100);
    color(255,255,d);
    For displaying alternate colored inner cells ie marks  I am using this formula
    whileprintingrecords;
    numbervar c;
    c := iif(c =255,100,255);
    color(255,255,c)
    I got these formulas after doing Googling
    My cross tab is present in report footer and in the generated report it comes separeated in two pages.
    In the first page data for Tammy and Sid is displayed while Julia is displayed on next page.
    Now the Tammy is coming as yellow colored and as expected Sid is coming as white colored. However Julia which is on next page is coming as white , but logically it should have come as yellow. On the other hand my column data ie marks column is coming fine. Data for tammy and sid is coming as alternately colored and data is Julia on the next page is coming as yellow(as data for Sid is in white)
    I am not able to understand why this is happening and what is the correct way to do alternate row coloring in cross tabs
    Edited by: thunderball10 on Aug 26, 2010 11:57 AM
    Edited by: thunderball10 on Aug 26, 2010 12:00 PM

    Where is your variable c being reset.
    If in page header or group header and you have repaet group header on new page then c will be reset on each page.
    If In groupheader try adding this to reset formula
    if not inrepeatedgroupheader then
    Ian

  • Using alternate rows with Spry Data Set

    Can anyone provide more information on how to implement alternate row colors with a Spry Data Set?  What I have done is:
    Create spry data set using HTML page as the data set
    The html page that displays the data set is:  <div spry:region="equipment">
    In the default.css page that is linked, I added the info in note #1 below
    When the page displays, no colors appear. Tried changing the colors and still no luck.  Is there another step to do?
    Note #1:
    within the default.css, the following are declared:
    #equipment odd {
    background-color: #CCC;
    #equipment even {
    background-color: “#F2F2F2;
    Note #2:
    Here is a link to see the actual pages referenced above.
    Any ideas? Getting frustrated!!  Thanks in advance for any advice.

    You are going to kick yourself, but, you haven't assigned any page element the ID #equipment. The region is called that but the table or the DIV does not have an idea and your selector matches nothing...

Maybe you are looking for

  • How can i transfer music from my ipod touch to my new computer

    i just got a new computer and im wondering how to transfer my music from my ipod touch to my itunes

  • Printing Only visible text

    Hi, I am trying to print an editable PDF from Adobe reader. The issue is that only the text visible in the edit boxes are printing. I have several paragraphs of written text in the editable boxes, but when it only prints the few sentences that are vi

  • Display problem import photos

    Hello, I have a display problem when I try to import photos into Lightroom. I use the version 5.2. The problem can be viewed in the following video. At the begining you can view that there is something weird as under the folder "Panoramas" there is a

  • Config of bank clearing ion FPCJ

    Dear Experts, On screen FPCJ, I want to have an additional bank clearing account in the drop-down field Clearing Account. In config Define Bank Clearing Accounts for Payment Lots, I defined an account but it is still not appearing. Is there any other

  • APEX 4.0 New Features Application

    Hello Is the APEX 4.0 New Features application available for download ? The application itself is available at http://apex.oracle.com/pls/apex/f?p=34738 Varad