DataTable header colors

Is there any way to set the header colors for individual columns vs. setting the color for the entire header?

I wrote up the solution for this and was about to post when I decided I'd better try it. Then I found it doesn't work; there's a bug in the JSF Data Table which causes the columnClasses property to not apply to the cells in the header section. (If you look at the rendered html page, you can see each <td> is assigned an item from the columnClasses list, but this is not the case for the <th>'s.). Or alternatively, the JSF data table authors did this deliberately, but failed to provide a style list property for the header; the "headerClass" property is not an iterator like rowClasses/columnClasses.
Thus, the solution I was going to suggest doesn't work for the data table.
With that fixed, the solution would have been this:
You should use the columnClasses property on the data table. (See this blog entry for more information on how that works:
http://blogs.sun.com/roller/page/tor/20041004#aligning_text_in_tables)
Note however that this will set the styleclass properties for the columns on every ROW in the table, not just in the header.
So assuming your columnClasses property for your three-column table was this: "col1,col2,col3"
you should put rules like this in the stylesheet:
thead .col1 { background-color: orange }
thead .col2 { background-color: indigo }
thead .col3 { background-color: lime }
In other words, you're writing rules for the case where there's a col1 class on an element within a <thead>.
-- Tor
http://blogs.sun.com/tor

Similar Messages

  • Problem with buttons in datatable header

    Hi
    I have command buttons in the datatable header .When I display the data in columns there is a gap between buttons .I want the buttons should be stretched automatically along with column data there should not be no gap between buttons regardless how big the data is in each column.
    Can anybody help me asap.
    Thanks.

    This issue is that the second header is an instance of the first, so all unmanaged relative code breaks. I would hazzard a guess to say that your add code looks like "$.parent.row1.instanceManager.addInstance(1)." This will break, as the "second" header row no longer sees the 'table' element as it's parent.
    Changing to code to a static reference will fix it... i.e. xfa.form.form1.table1.row1.instanceManager.addInstance(1).
    This should solve it for you... if not, let me know.
    - Scott

  • Change column header color LV 8.20

    I am displaying tabular data and a graph. How do I change the table column heading color, so they match the colors assigned to the graph?
    Thanks,
    Jim Purdy
    LabVIEW 8.21 on WinXP

    Hi Jim,
    try yourself with this VI. Consider the "active cell" indices are I32, so they can be negative.
    Greets, Dave
    Greets, Dave
    Attachments:
    change Table Color.vi ‏12 KB

  • APEX 4  IR Column Heading colors

    When column labels in APEX 4 split into 2 lines, the expanded column heading colors don't match. See the below example.
    http://apex.oracle.com/pls/apex/f?p=35096:2
    The column label "User<br> Name" is causing the header to have two colors. This was not an issue in previous versions of APEX. How can this be fixed?
    Rob
    Edited by: rlm on Jul 7, 2010 5:00 AM

    Hi,
    When you overwrite css styles the order is important. Your code source (extract):
    <head>
      <title>Report on DEMO_USERS</title>
      <link rel="icon" href="/i/favicon.ico" type="image/x-icon">
      <link rel="shortcut icon" href="/i/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="/i/css/apex_4_0.css" type="text/css" /><!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_4_0.css" type="text/css" /><![endif]--><link rel="stylesheet" href="/i/libraries/jquery-ui/1.8/themes/base/jquery-ui-1.8.custom.min.css" type="text/css" /><script type="text/javascript">var apex_img_dir = "/i/", htmldb_Img_Dir = apex_img_dir;</script><script src="/i/libraries/jquery/1.4.2/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="/i/javascript/apex_4_0.js" type="text/javascript"></script>
    <script src="/i/javascript/apex_legacy_4_0.js" type="text/javascript"></script>
    <script src="/i/javascript/apex_widget_4_0.js" type="text/javascript"></script>
    <script src="/i/javascript/apex_dynamic_actions_4_0.js" type="text/javascript"></script>
    <script src="/i/libraries/jquery-ui/1.8/ui/minified/jquery-ui-1.8.custom.min.js" type="text/javascript"></script>
    <style type="text/css">
    .apexir_WORKSHEET_DATA th
    background: #605E5E;
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <link rel="stylesheet" href="/i/themes/theme_1/css/theme_4_0.css" type="text/css" />
      <!--[if IE]><link rel="stylesheet" href="/i/themes/theme_1/css/theme_4_0_ie.css" type="text/css" /><![endif]-->
      <!--[if IE 6]><link rel="stylesheet" href="/i/themes/theme_1/css/theme_4_0_ie6.css" type="text/css" /><![endif]-->
      <!--[if IE 7]><link rel="stylesheet" href="/i/themes/theme_1/css/theme_4_0_ie7.css" type="text/css" /><![endif]-->
    </head>note that theme_4_0.css include comes after your code, try put your code after the inclusion.
    Kind regards,

  • Portlet Header Color

    Hi All,
    I want to know , how to change the style of a page so that each Portlet can be displayed with his own Portlet Header color but not with the default
    Portlet Header color of the page:
    Is this possible?
    Thanks in advance
    null

    The page style allows you to define only one color for the portlet header. You could try adding some HTML portlets to your page that override the style used for the portlet header.
    Regards,
    Jerry

  • Image on Datatable header

    Hi all.
    We need to include an image (<img>) in the header of a table. Is it possible? So far we could only add text to the headers.
    Thanks in advance

    JSF table - column width are set in the styleclasses available through the h:dataTable itself.
    There is a property - columnClasses where you can specify the column width of each column (you will have to specify a styleclass for each column though)
    For example if you have 3 columns in the dataTable and you want to give
    5% width to the first column, 5% to the second and 90% for the last, you can create the following css stylesheet classes (watch the width field down here):
    .AdminSectionSelector {
    border-bottom-color: #c4c4f9;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    text-align: center;
    width: 5%
    .AdminSectionPublish {
    border-bottom-color: #c4c4f9;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    text-align: center;
    width: 5%
    .AdminSectionData {
    border-bottom-color: #c4c4f9;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    width: 90%
    Now in your h:datatable columnclasses, you specify like this:
    columnclasses=AdminSectionSelector,AdminSectionPublish,AdminSectionData
    Hope it helps,
    BB

  • Datatable header display issue

    Hi,
    I need to display more then one component in the header of a datatable. Currently, we are able to display the table along with the header values using datatable. Next to the header we want to display 2 icons, one to denote sorted by descending and another to denote that
    table values are sorted by ascending. We tried some thing like as show below
    <h:dataTable styleClass="dataTable" value="#{list}" var="plist">
    <h:column>
    <f:facet name="header">
    <h:commandLink action="#{form.sortDescending}">
         <h:graphicImage value="/descending.jpg"/>
    </h:commandLink>
    <h:outputText value="HeaderDisplayName" ></h:outputText>
    <h:commandLink action="#{form.sortAscending}">
         <h:graphicImage value="/ascending.jpg"/>
    </h:commandLink>
    </f:facet>
    <h:outputText id="value" value="#{list.value}" />
    </h:column>
    when I execute the above code, I get to see only the descending image.
    The header name and ascending image are not visible. Could you please help me resolve this issue?
    Thank you,
    DargonHorse

    you should use one component inside a facet.. So, you can solve your problem by encapsulating all that command links and outputtext inside a jsppanel component.. like;
    <f:facet name="header">
    <jsppanel>
    <h:commandLink descending...>
    <h:outputText header >
    <h:commandLink ascending... >
    <jsppanel />
    </f:facet>

  • Link Action in datatable header not working!!!

    hi all
    i want to sort the datatable rows when link in the header of a column in datatable is clicked. I am using Sun Creator but it doesnot provide functinality to directly add link action in header. So i changed the jsp page to add the following code
    <h:dataTable binding="#{SearchResults.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd" style="left: 24px; top: 24px; position: absolute" value="#{SearchPage.searchResultsDataModel}" var="currentRow">
    <h:column binding="#{SearchResults.column1}" id="column1">
    <f:facet name="header">
    <h:commandLink action="#SearchResults.linkActionApplicantIDHeader_action}"
    binding="#{SearchResults.linkActionApplicantIDHeader}" id="linkActionApplicantIDHeader">
    <h:outputText binding="#{SearchResults.linkActionApplicantIDHeaderText}" id="linkActionApplicantIDHeaderText" value="Applicant ID"/>
    </h:commandLink>
    </f:facet>
    </h:column>................... other columns of table(bold is what i added )
    if i check through the IDE application outline window that which action handler is associated with my header link action, it takes me to proper method. but while running it doesnot go to the proper method and hence doennot fire the event.
    what should i do??
    plz help
    thanks

    hi all
    i want to sort the datatable rows when link in the
    header of a column in datatable is clicked. I am
    using Sun Creator but it doesnot provide functinality
    to directly add link action in header. So i changed
    the jsp page to add the following code
    <h:dataTable binding="#{SearchResults.dataTable1}"
    " headerClass="list-header" id="dataTable1"
    rowClasses="list-row-even,list-row-odd" style="left:
    24px; top: 24px; position: absolute"
    value="#{SearchPage.searchResultsDataModel}"
    var="currentRow">
    <h:column binding="#{SearchResults.column1}"
    id="column1">
    <f:facet name="header">
    <h:commandLink
    action="#SearchResults.linkActionApplicantIDHeader_act
    ion}"
    binding="#{SearchResults.linkActionApplicantIDHeader}
    " id="linkActionApplicantIDHeader">
    <h:outputText
    binding="#{SearchResults.linkActionApplicantIDHeaderTe
    xt}" id="linkActionApplicantIDHeaderText"
    value="Applicant ID"/>
    </h:commandLink>
    </f:facet>
    </h:column>................... other columns of table(bold is
    what i added )
    if i check through the IDE application outline window
    that which action handler is associated with my
    header link action, it takes me to proper method. but
    while running it doesnot go to the proper method and
    hence doennot fire the event.
    what should i do??
    plz help
    thanksI had a similar problem w/ links in a datatable that didn't work. I had to do two things:
    1. Initialize the SearchPage.searchResultsDataModel property in the constructor of the bean (this is because I use request scope).
    2. Remove the rendered property from the surround h:panelGroup tag that I have around my table. I haven't been able to get the rendered property to work with the datatable links.
    Hope this helps!

  • Changing the Column Header Color

    I would like to change the foreground and background color of a column header when the user clicks on the column. I know how to detected when the user clicks on a given column, and I know there is a setBackground and setForeground method that needs to be called, the that is my problem, I don't know which setBackground/Foreground methods to call.
    Thanks in advance for any help.

    Hi,
    I fixed my problem using the setBorder() method for my table header.
    thanks.

  • Datatable header with a lot of columns

    I have a problem: I want to create a datable like Microsoft Excel, and in a <h:column> of datatable, I want to split this column to 3 child columns. So header of this column has 1 merged row, and 1 row with 3 columns.
    This is my simulated header:
    | Merged row |
    | Child row 1 | Child row 2 | Child row 3 |
    How to create this header? Please help me. Thanks
    TNTVN

    use <f:facet name="header" />
    example
    <h:panelGrid columns="3">
    <f:facet name="header">
    <h:outputText value="Merged row" />
    </f:facet>
    <h:outputText value="Child row 1" />
    <h:outputText value="Child row 2" />
    <h:outputText value="Child row 3" />
    </h:panelGrid>

  • Datatable Header Freeze

    I am using JSF 2.0 .I need provide the vertical scrollbar and horizontal for the datatable.
    I achieved using stylesheet.
    But the header of the datatable is also scrolling
    Is there any build in method to freeze the header of datatable.
    or can u plz provide me the solution to freeze the header of the datatable

    With pure JSF: no way.
    However richfaces has a scrollableDataTable that does what you need.
    http://livedemo.exadel.com/richfaces-demo/richfaces/scrollableDataTable.jsf
    The trouble is that for JSF 2.0 you'll want Richfaces 4.0, which is still in development. I have read that Richfaces 3.3.3 can work with JSF 2.0, but I never tried that.

  • AdvancedDataGrid view Header color and text

    Hi,
    I want to change the color of datagrid header as well as change the color of header text(only) not entire column.
    i dont know how to do this .please help me boz i m new in flex.

    Nevermind, i figured out that you keep the same way of drawing for lines and ovals in graphics2d as in regular graphics...
    anyways, I tried this and what happens is that everything turns black... the background does not change...
    i think it has something to do with the following important lines:
    metabolicImage = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
    Graphics2D g;
    g = (Graphics2D) metabolicImage.getGraphics();
    g.setPaint(Color.white);
    then later....
              if (type == 'C')
                   StringTokenizer circ = new StringTokenizer(Instr, "\t");
              trash = circ.nextToken(); // get first token C1, C2, etc
              x =     Integer.parseInt(circ.nextToken()); // get circle's x location
              y = Integer.parseInt(circ.nextToken()); // circle's y location
              r = Integer.parseInt(circ.nextToken()); // circle's radius
              g.setPaint( Color.black );
              g.drawOval(x-4,y-4,2*r,2*r);
    I think somehow the image has a default background... is there anyway to change the color of the image background?

  • DataGridColumn Header Color

    How do I define the background color of a Datagrid's header?
    I'm building the Datagrid dynamically, creating each
    DataGridColumn. How do I change the background color of a
    DataGridColumn's header?

    Set your headerColors in the css for the datagrid and then
    define a headerStyleName
    DataGrid {
    headerColors:#606060,#ffffff;
    headerStyleName:"gridHeaderStyle";
    .gridHeaderStyle {
    color: #fff666;
    }

  • Changing only column header color

    Hello,
    I changed the background color of the tabel to white. But column headers are also appearing as white. How can I change the color of column headers only. I tried several combinations...no luck.
    Thanks,
    Sunita.

    Hi Sunitha,
    You do like below.
    1)In the Table Column delete the dafault Table header.
    2)Insert FixedYTopCell to the above column and insert TextView to FixedYTopCell.
    3)Change the cell Design Property of FixedYTopCell   to grouplevel2
    4)Change the SemanticColor Property of TextView   to negative or accroding to your.
    That will change header column color
    Regards
    -SS

  • HT203244 changing header color in safari

    IS IT POSSIBLE TO CHANGE FONT SIZE AND OR COLOR IN THE HEADER(S) IN SAFARI ..? MY EYE SIGHT IS POOR AND LARGER FONT WOULD HELP. TRIED THE ACCESSIBLITY OPTIONS WITH LITTLE HELP

    why doesn't anybody answer this ? i have the same problem......
    also, my table appears with the correct data but is wayyyyyyy too large for any browser - i gave the table the attribute width="800px".....
    and also, the lines are very large, the font too large......
    how do i customize all this ?
    thx,
    dom.

Maybe you are looking for

  • Changing text size in form field (rich text formatting enabled)

    Hi all, I'm hoping someone can help me out here. I've created an interactive PDF with form fields with "Rich Text Formatting" enabled. My client has filled in the fields and would like to make the text bigger. When right-click, there are only options

  • 2 ipod touches...can I use one apple id?

    I have purchased 2 new ipod touches for my kids for Christmas. Can I use the same apple ID I currently have for both of them? Or will I have to create new ID's for both of them? They are both under 16 and I would like to have one ID so that I am the

  • RZ20 server host entries disappear under Operating System Node

    Hi, I am trying to setup auto reaction methods in RZ21 and want to assign them to properties in RZ20 on SolMan (as my CEN) under Operating System -> <server host> -> filesystems -> <file path of choice> -> Percentage_Used for the percentage_used i as

  • Recording straight to hard drive

    Some friends of mine what to shoot on a Sony HDV V1U, and record straight to an external hard drive. Is the proper procedure to start FCP on a lap top and capture just like it was from a tape through fire wire or is there a better method for this? Th

  • Magazines

    I don't have an iPad yet (I'm waiting for 2nd generation). But one thing I do want to do when I get one is subscribe to some magazines. Specifically National Geographic and some photography magazines. Currently the only digital subscription to NatGeo