TableView - different background color of header cell

Hello,
I'd like to render table view with header cell of certain background color.
I think I can use <i> IHeaderCellRenderer </i> but I can't find out how to set background color from javadoc.
Best regards,
Josef Motl

Try using something like:
tableView.setStyleForCell(i, column, TableCellStyle.SUBTOTAL);
Best regards
Francisco

Similar Messages

  • UITableView: set different background colors for header and the table

    I would like to set my background color for my UITableView to white and set my tableViewHeader backgroundColor to grayColor similar to the facebook app. When I bounce scroll my table so that you can see above the header, then currently it is white above the header view. I want that to be brown instead.
    In the facebook app, above the headerview, it is a blue color and below the table is a white color. If i try and set the UITableView backgroundColor to brown, then the top will be brown, but so will the bottom. Additionally, all of the unset cells will have a brown background instead of white.
    Any help with this?

    Fixed..

  • Different background color in panelBox's header

    Hi,
    I need to have a different background in the header of the panelBox than the background color of its content.
    <af:panelBox text="Aug 8, 20121"
    id="pb5"
    titleHalign="center"
    type="flow"
    showDisclosure="false"
    ramp="highlight"
    background="light">
    I understand that we can change style in css. But I only want this style of panelBox apply to one UI page only. It should not affect panelboxes in other UI pages.
    How can I achieve this? What's the syntax of changing the background color of panelBox's header?
    Thanks
    -Mina

    Hi,
    the solution is to use instance specific skinning. In this you define a styleCalss name for the panel box you want to change
    <af:panelBox
      icon="/skins/images/guy.gif"
      text="PanelBox Instance Skinned"
      styleClass="DifferentBackgrundColor">
          <f:facet name="toolbar"/>
    </af:panelBox>.DifferentBackgrundColor af|panelBox::header-start,
    .DifferentBackgrundColor af|panelBox::header-center,
    .DifferentBackgrundColor af|panelBox::header-end,
    -tr-inhibit:background-image;
    background-color:red;
    Frank

  • How to control background color of table cell in an html report?

    I am using Labview 6.1 to generate a report.  In that report there is a table created using the Append Numeric Table to Report VI.  I want to be able to programmatically control the background color of each cell in the table.  Also, how can I programmatically control the background color of the row and header cells of the same table.  I am also generating a second table in the same report using the Append Text Table to Report VI and I would like to programmatically control the background colors of the cells in that table as well.  Thanks.

    Hi epsilon-d...,
    i´m not sure if there is an ready to use function to do what you want, but you can enlarge the available function. Open the "Append Numeric Table to Report.vi" and go to the HTML Case. There you can see another vi which creates the html table. In the VI "HTML Report Table Row" you can add the option: bgcolor="your color" inside of the "TR" tag.
    Hope it helps.
    Mike

  • Rows with different background color in array

    I am displaying an array indicator. When certain values are found in a row of the array, I would like the row to have a different background color so that it stands out on the front panel. Can this be done? Especially, can this be done using property nodes dynamically?
    Thank you

    Hi jmaarek,
    I don't think you can do this with arrays as all the elements have the same properties.
    You can do this with a table though. Use the 'Active Cell' property (set the row to -2 to select the entire row) and the 'CellBGColor' property.
    Hope this helps.

  • Change different background color in row grid

    Hi,
        i want to change different  background color in row grid..ex.two different colors should continue in all row grid..pls guide me ..
    Regards,
    Senthil.

    Hi Senthil,
    If I understand you correctly, you wish to show a grid with alternating colours down the rows.
    You have a few options:
    1) Apply a stylesheet nd display it as HTML.  But this solution lacks the advantages of the iGrid
    2) Return a field with alternating 1's and 0's in the query and use this field in the Colour-Context mapping
    3) Use JavaScript to loop through each row and set alternating background cell colour for all columns
    Hope this helps.
    Cheers,
    Jai.

  • How to change the Background color of a cell in JTable

    hi!
    Actually i want to change the background color of few cells in JTable
    is there any method to make this change in JTable ?
    and also is it possible to have 5 rows with single column and 5 rows with 3 columns in a single JTable

    i want to change the background color of few cells in JTableDepending on your requirements for the coloring of cells it may be easier to override the prepareRenderer() method of JTable:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=610474

  • How to change the background color of a cell in datagrid using flex3

    i want to change the background color of a cell.....how can i achieve this.....and also i want to know how a spacing cane be done between cells in a datagrid...plzzz help me???

    The only way I can see to do this is to use an item renderer for your cells.  This is really scruffy and would need tyding up, and maybe with a little more time could do better or someone else may have an idea but none the less this works.
    Define a custom component as below;
    This has logic to see what the value of the data is proveided by the dataprovider for the row, and if it matches the conditions in this case is equal to 5 sets the background color.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="88" height="26" dataChange="doColor()" borderColor="#000000" borderStyle="solid"
        backgroundAlpha="1">
        <mx:Script>
            <![CDATA[
                private function doColor():void {
                    if (data.value == 5) {
                        setStyle('backgroundColor', 0xcccccc);
                    } else {
                        setStyle('backgroundColor', 0xffffff);
            ]]>
        </mx:Script>
    </mx:Canvas>
    Now just apply the item renderer in the datagrid and that will do it.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  xmlns:ns1="*">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                [Bindable]
                private var ac:ArrayCollection = new ArrayCollection([
                    {value : 1},
                    {value : 2},
                    {value : 3},
                    {value : 4},
                    {value : 5},
                    {value : 6},
                    {value : 7},
                    {value : 8},
                    {value : 9},
                    {value : 10}
          ]]>
        </mx:Script>
        <mx:DataGrid x="40" y="36" width="408" height="193" dataProvider="{ac}">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="value" itemRenderer="MyComp"/>
                <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
                <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>
    I hope this helps
    Andrew

  • Change the background color of a cell in JTable

    Hi all,
    How can I change the background color of individual cell in JTable. I need to construct my own TableCellRenderer or not? I'm now using the DefaultTableCellRenderer now.
    Thx

    You could create your own renderer or you could try something like:
    table = new JTable(model)
         public TableCellRenderer getCellRenderer(int row, int column)
              DefaultTableCellRenderer tcr =
               (DefaultTableCellRenderer)super.getCellRenderer(row, column);
              if (row == 1 && column == 1)
                   tcr.setBackground(Color.green);
              else
                   tcr.setBackground(Color.red);
              return tcr;
    };

  • Can I get different background colors on menu items?

    I've been trying to get different background colors on my menu (Quick launch) items for a while, without success. What I want is the even numbered items (the second, fourth, sixth...) to have a different background color than the uneven ones (first, third,
    fifth...).
    Anyone knows if this can be done?
    Thanks, guys!

    Can you do something in the javascript code where you have given specific IDs to each buttons in your menu? It could end up in something like "$('#menu_id').css('background-color', '#1B3E70');"
    Or, let say you have controls defined like thie:
    <body>
    <ul class="menu">
    <li class="menu-item"><a>item 1</a></li>
    <li class="menu-item"><a>item 2</a></li>
    <li class="menu-item"><a>item 3</a></li>
    </ul>
    </body>
    Can't you write at render stage this kind of actions by index:
    var i = $("li").index( $(this).parent() );
    if ( i === 1 ) {
    $('body').css('background', 'red');
    } else if ( i === 2 ) {
    $('body').css('background', 'green');
    } else {
    $('body').css('background', 'brown');

  • Different background color in  summation

    Is there any possibilities to set the different background color and applied the conditional format in summation columns in vertical table in obiee answers.
    Kindly let me know asap.
    Thanks in advance.

    Hi,
    Do you mean in grand total columns? if so just click on edit table view >> beside the summation symbol click on the properties button there you can change the font color or back ground color etc...
    Update if required.
    Mark if Helpful/correct.
    Thanks.

  • Background color of the cell in EXCEL not working....Pls help..

    Hi gurus,
    I have written a procedure to change the background color of the cell in EXCEL.The code is as below..
    PROCEDURE set_header     (p_row IN NUMBER, p_col IN NUMBER, p_value IN VARCHAR2, p_border IN VARCHAR2 DEFAULT 'N',p_bgcolor IN VARCHAR2 DEFAULT 'N') IS
    BEGIN
         v_args     := ole2.create_arglist;
         ole2.add_arg(v_args, p_row);
         ole2.add_arg(v_args, p_col);
         v_cell     := ole2.get_obj_property(v_worksheet, 'cells', v_args);
         v_font     := ole2.get_obj_property(v_cell, 'font');
         ole2.set_property(v_font, 'fontstyle', 'bold');
         ole2.set_property(v_font, 'size', 9);
         ole2.destroy_arglist(v_args);
         if p_border = 'Y' THEN
              v_border := ole2.get_obj_property(v_cell, 'Borders');
              ole2.set_property(v_border, 'LineStyle', 1);
              ole2.release_obj(v_border);
         End If;
         if p_bgcolor ='Y' THEN
              v_bgcolor := ole2.get_obj_property(v_cell,'Bgcolor'); --This is not woking
              ole2.set_property(v_bgcolor,'bgcolor','red');
              ole2.release_obj(v_bgcolor);
         End If;
              ole2.set_property(v_cell, 'value', p_value);
              ole2.release_obj(v_cell);
         END set_header;
    Pls tell me how to change the backcolor and forecolor in the cell...
    Thanks

    The background color is set for the "Interior" object of the selected cells (Range).
    Try something like this (haven't tested it):
    v_interior := ole2.get_obj_property(v_cell,'Interior');
    ole2.set_property(v_interior,'ColorIndex',3); --should be red
    ole2.release_obj(v_interior);
    If the Foreground color = Font Color then
    ole2.set_property(v_font,'ColorIndex',6); --should be yellow
    Gerald

  • Setting background color of a cell

    Hi guys,
    Iam writing to screen as follows.
    daTA str TYPE string.
      LOOP AT gt_ditab.
        CLEAR str.
        WRITE: /1(1)'|'
        , 2(12) gt_ditab-vbeln LEFT-JUSTIFIED,14(1)'|'
        , 15(12) gt_ditab-bstnk LEFT-JUSTIFIED, 27(1)'|'.
      IF ( gt_ditab-verbrauchnr EQ space OR gt_ditab-verbrauchnr IS INITIAL ).
        str = 'N'.
       WRITE: 28(12) str COLOR 6 , 40(1)'|'.
        ELSE.
          WRITE: 28(12) gt_ditab-verbrauchnr LEFT-JUSTIFIED , 40(1)'|'.
        ENDIF.
        WRITE: 28(12) gt_ditab-verbrauchnr LEFT-JUSTIFIED , 40(1)'|',
           /1(40) sy-uline.
      ENDLOOP.
    if "gt_ditab-verbrauchnr"  is empty ,I want the background color of this cell(Only this cell) set to light red. I tried something as above.(See bold code)
    But the cell colour is not changing.What am I doing wrong?
    Thanks
    K

    i will give you a sample code.. go though this...
    data flag type vbak-vbeln.
    DATA str   TYPE string.
    DATA : ABS type string.
    DATA : frac type i.
    do 10 times.
    WRITE: /1(1)'|'
    , 2(12) '123' LEFT-JUSTIFIED,14(1)'|'
    , 15(12) 'def' LEFT-JUSTIFIED, 27(1)'|'.
    abs = sy-index / 2 .
    frac = frac( abs ).
    if frac is INITIAL.
      flag = '000001234'.
    else.
      clear flag.
    endif.
    IF  flag is INITIAL..
    str = 'N'.
    WRITE: 28(12) str COLOR 6 , 40(1)'|'.
    clear str.
    ELSE.
    WRITE: 28(12) flag LEFT-JUSTIFIED , 40(1)'|'.
    ENDIF.
    WRITE /1(40) sy-uline.
    ENDDO.
    check and get back..

  • How to change the background color of a cell based on other cell background

    Hi,
    Sorry if this is a basic question - I am new to XML. I want to create a table column, with no data in it. I then want to change the background color of the column based on the background color of other columns. I.E.
    - If there are 3 or less cells in this row that are not green, color this cell green.
    - If there are 4 or less cells in this row that are not green, and 3 or less are not red, color this cell yellow.
    - If there are 4 or less cells in this row that are not green, and 3 or more are red, color this cell red.
    If there are 5 or more cells in this row that are not green, color this cell red.
    Many thanks for any assistance.

    Okay - I have this resolved.
    1. Create two variables (Yellow and Red):
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', 0)?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', 0)
    2. For each cell, set the background based on their individual traffic light criteria, and update the associated color variable by 1. By default the backgrd color is set to Yellow so I only have to check for the lower and upper bounds:
    <?choose:?>
    <?when:number(CHECKED_IN)<=1?>
    <?attribute@incontext:background-color;'Lime'?>
    <?end when?>
    <?when:number(CHECKED_IN)>3?>
    <?attribute@incontext:background-color;'Red'?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', xdoxslt:get_variable($_XDOCTX, 'Red') +1)?>
    <?end when?>
    <?otherwise?>
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', xdoxslt:get_variable($_XDOCTX, 'Yellow') +1 )?>
    <?end otherwise?>
    <?end choose
    3. I now want a cell that is Red if any of the cells in the row is red. Its yellow of there are 3 or more yellow cells in the row, and no reds. Otherwise its green. First, create an empty cell and make the default color green. Then add:
    <?if: number(xdoxslt:get_variable($_XDOCTX,'Red')) > 0?>
    <?attribute@incontext:background-color;'Red'?>
    <?end if?>
    <?if: number(xdoxslt:get_variable($_XDOCTX,'Yellow')) >= 3 and number(xdoxslt:get_variable($_XDOCTX,'Red')) = 0?>
    <?attribute@incontext:background-color;'Yellow'?>
    <?end if?>
    4. Finally, reset the variables for the next row:
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', 0)?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', 0)

  • How do I change the colors of Ring texts individually so when it pulls down, I can see each test with different background color?

    I have been using LabView for a almost 18 months now. There was no problem which I could not solve with help of all resources available. But, this is one where I am scratching my head since long time now.
    I would like to change colors of each individual text in Ring control programmatically. I have attached example VI. In this VI, I change background color of ring text, but it changes only the current (active) background color, so when you pull down the whole menu, it shows same default color for all the text background (not even the color I asked it to). Is there anyway I can define individually as to what color should be related to each text in ring menu?
    Attachments:
    Ring Menu Colors.JPG ‏16 KB
    RGB Ring.vi ‏33 KB

    " Is there anyway I can define individually as to what color should be related to each text in ring menu?"
    Well not with a ring and not programatically.
    The best I can suggest is a picture ring, see below.
    Ben
    Message Edited by Ben on 11-18-2005 02:16 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Picture Ring.JPG ‏5 KB

Maybe you are looking for

  • Add ipad iPhone iPod one account

    What ids the best method to set up, configure, add and use multiple Apple products(devices) under the same ID and that other family members can also set up their multiple devices all under a cohesive group setting with privacy for each member protect

  • Can I purchase a TV season and download one episode at a time?

    So this is a noob question as I've never bought TV shows through iTunes. I want to buy all the episodes of a season in one payment, but I plan to download in 1080p so obviously it would be nice not to have to download all the episodes at once. Sure,

  • Error in writing to file - Oracle

    Dear All, We have to upgrade Oracle from 10.2.0.2 to 11.2.0.2. For this we are applying patches till 10.2.0.4. OS is AIX 6.1. Before proceeding I have stopped SAP, DB, Listerner and emctl also. But after starting the patches we found the msg that, Er

  • Asm_Instance_startup_issue

    Hi All,   Iam not able to start the ASM instance in 11.2 , below are the information , please help me to solve this. Even ASMCMD shows Connected to an idle instance. IN /etc/oratab iam not seeing +ASM instance details like +ASM<grid_home>:N ( no info

  • Item label font

    How to change the Select List / Texfield label font in Apex ? Yogesh