How to color specific row in a table....

Hi all,
I created a table out of an Array[]. The table is successfully filled up by array's elements. Each element is a row.
I want to be able to color specific row; instead of every row. How do I do that?
I was looking rendering to color a row or a string; but not successfull.
Thank you for your time and assistence.

My favorite way of doing this is to use CSS. You plan on giving the row you want colored an id attribute, then provide a style like this:
<style type="text/css">
  tr#colorMe td {
    background-color:blue;
</style>Then, when you want to color the row, you make the HTML output like this:
<table ...>
  <tr> //normal row
    <td></td><td></td><td></td>
  </tr>
  <tr id="colorMe"> //colored row
    <td></td><td></td><td></td>
  </tr>
  <tr> //normal row
    <td></td><td></td><td></td>
  </tr>
</table>

Similar Messages

  • To color a specific row in a Table UI element

    Hello Experts,
    We have a requirement to highlight (with distinguish color) a specific row of a table UI based on column data.
    Suppose we have a table with 5 column and 10 row, now if the data on 5th column greater than some XYZ value then we need to highlight the specific row with a different color.
    Can anyone please help me to achieve this requirement?
    Thanks & Regards,
    Sambaran Chakraborty

    Hi,
    In your outline, I am missing quite a few prerequisites which I mentioned (not sure if you have implemented them already)
    your sub node, does it have singleton=false, cardinality 1..1 and selection cardinality 1..1?
    The attribute of type TableCellDesign in that sub node, does it have the calculated property to true?
    If you've bound each table column's cellDesign property to this calculated attribute, you just put some code in the generated generated get<SubNode><CalcAttribute> method to set the color
    For instance by just entering the line
    return WDTableCellDesign.CRITICALVALUE_LIGHT
    in that method will render each linked cell to that color
    Not sure what else I can say to explain this, there's not much to code...

  • How to identify one specific row in the table STPO?

    Hi!
    How can I identify one specific row in the table STOP? As an input for my ABAP function I have MatNr, Plant, Alternative, BomUsage and Bom Position (0010, 0020...). With these values I can ask the table MAST to get the STLNR. But how can I get all needed values to specify an entry in the table STPO then?
    Thanks,
    Konrad

    Here is a actual working code that we used here.
    *-- get the bom details
      li_mast-mandt = sy-mandt.
      li_mast-matnr = material.
      li_mast-werks = '6000'.
      li_mast-stlan = '1'.
      call function 'GET_MAST'
           exporting
                all             = 'X'
                no_buffer       = 'X'
                set             = 'X'
           tables
                wa              = li_mast
           exceptions
                call_invalid    = 1
                end_of_table    = 2
                get_without_set = 3
                key_incomplete  = 4
                key_invalid     = 5
                no_record_found = 6
                others          = 7.
      if sy-subrc <> 0.
        clear: kdf_material,
               kdf_material_desc.
        exit.
      endif.
      loop at li_mast.
    *-- get the valid headers
        move-corresponding li_mast to li_stko.
        li_stko-stlty = 'M'.
        call function 'GET_STKO'
             exporting
                  all             = 'X'
                  datub           = l_valid_date
                  datuv           = l_valid_date
                  del             = ' '
                  no_buffer       = 'X'
                  set             = 'X'
                  valid           = 'X'
             tables
                  wa              = li_stko
             exceptions
                  call_invalid    = 1
                  end_of_table    = 2
                  get_without_set = 3
                  key_incomplete  = 4
                  key_invalid     = 5
                  no_record_found = 6
                  others          = 7.
        if sy-subrc <> 0.
          continue.
        endif.
        loop at li_stko.
          move-corresponding li_stko to li_stpo.
          call function 'GET_STPO'
           exporting
             all                    = 'X'
             alter                  = li_stko-stlal
             datub                  = l_valid_date
             datuv                  = l_valid_date
             no_buffer              = 'X'
             set                    = 'X'
             valid                  = 'X'
    *        VIEWNAME               =
           tables
             add_wa                 = li_cszalt
             wa                     = li_stpo
           exceptions
             call_invalid           = 1
             end_of_table           = 2
             get_without_set        = 3
             key_incomplete         = 4
             key_invalid            = 5
             no_record_found        = 6
             viewname_invalid       = 7
             others                 = 8.
          if sy-subrc <> 0.
            continue.
          else.
            exit.
          endif.
        endloop.
        if not li_stpo[] is initial.
          exit.
        endif.
      endloop.

  • How to determine specific row in table clicked on

    Hello -
    I need to determine the specific row of a table control that is right-mouse-clicked on.  I think this is only possible by using the Shortcut Menu Activation? event for the table control and obtaining the vertical coordinate in the Coords filter options. 
    This entails performing experiments to determine the vertical range of each row in the table, or perhaps by determining the width of one row and using a linear relationship to determine the possible range of subsequent rows.  Do you feel this is the best strategy or is there possibly another easier way to obtain this information?
    Thanks,
    Don
    Solved!
    Go to Solution.

    Pop up on the Table and CREATE INVOKE NODE for POINT TO ROW COLUMN.
    Place that node on your diagram.
    Feed the COORDS cluster to that node, and out comes the row and column you clicked on.
    Be careful of edge cases, I don't remnember exactly, but if you have scroll bars visible, you might have to take them into account.  Use the IN BOUNDS output
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • How can i update rows  in a table based on a match from a select query

    Hello
    How can i update rows in a table based on a match from a select query fron two other tables with a update using sqlplus ?
    Thanks Glenn
    table1
    attribute1 varchar2 (10)
    attribute2 varchar2 (10)
    processed varchar2 (10)
    table2
    attribute1 varchar2 (10)
    table3
    attribute2 varchar2 (10)
    An example:
    set table1.processed = "Y"
    where (table1.attribute1 = table2.attribute1)
    and (table1.attribute2 = table3.attribute2)

    Hi,
    Etbin wrote:
    Hi, Frank
    taking nulls into account, what if some attributes are null ;) then the query should look like
    NOT TESTED !
    update table1 t1
    set processed = 'Y'
    where exists(select null
    from table2
    where lnnvl(attribute1 != t1.attribute1)
    and exists(select null
    from table3
    where lnnvl(attribute2 != t1.attribute2)
    and processed != 'Y'Regards
    EtbinYes, you could do that. OP specifically requested something else:
    wgdoig wrote:
    set table1.processed = "Y"
    where (table1.attribute1 = table2.attribute1)
    and (table1.attribute2 = table3.attribute2)This WHERE clause won't be TRUE if any of the 4 attribute columns are NULL. It's debatable about what should be done when those columns are NULL.
    But there is no argument about what needs to be done when processed is NULL.
    OP didn't specifically say that the UPDATEshould or shouldn't be done on rows where processed was already 'Y'. You (quite rightly) introduced a condition that would prevent redo from being generated and triggers from firing unnecessarily; I'm just saying that we have to be careful that the same condition doesn't keep the row from being UPDATEd when it is necessary.

  • How to identify migrated rows on a table

    Hi, folks,
    I'm wondering how to identify migrated rows on a table.
    I understand that ANALYZE generates data into CHAINED_ROWS. The Oracle document implies that this table has both CHAINED ROWS and MIGRATED ROWS. FYI:
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/general.htm#sthref1881
    But how can I tell migrated rows from chained rows.
    Thanks!
    Alex

    im also not looking to ExporttoExcel feature on ADF just copy all the records displayed on a table
    im also not looking to ExporttoExcel feature on ADF just copy all the records displayed on a table ,
    Hi you can set the property( exportedRows) of exportListener
    you can limit the number of rows to download
    chekout documentaion
    ADF RichClient API - af:exportCollectionActionListener

  • How to compare two rows from two table with different data

    how to compare two rows from two table with different data
    e.g.
    Table 1
    ID   DESC
    1     aaa
    2     bbb
    3     ccc
    Table 2
    ID   DESC
    1     aaa
    2     xxx
    3     ccc
    Result
    2

    Create
    table tab1(ID
    int ,DE char(10))
    Create
    table tab2(ID
    int ,DE char(10))
    Insert
    into tab1 Values
    (1,'aaa')
    Insert
    into tab1  Values
    (2,'bbb')
    Insert
    into tab1 Values(3,'ccc')
    Insert
    into tab1 Values(4,'dfe')
    Insert
    into tab2 Values
    (1,'aaa')
    Insert
    into tab2  Values
    (2,'xx')
    Insert
    into tab2 Values(3,'ccc')
    Insert
    into tab2 Values(6,'wdr')
    SELECT 
    tab1.ID,tab2.ID
    As T2 from tab1
    FULL
    join tab2 on tab1.ID
    = tab2.ID  
    WHERE
    BINARY_CHECKSUM(tab1.ID,tab1.DE)
    <> BINARY_CHECKSUM(tab2.ID,tab2.DE)
    OR tab1.ID
    IS NULL
    OR 
    tab2.ID IS
    NULL
    ID column considered as a primary Key
    Apart from different record,Above query populate missing record in both tables.
    Result Set
    ID ID 
    2  2
    4 NULL
    NULL 6
    ganeshk

  • How to change background color of row of a table in a panel table

    hi! im trouble right now, somebody help me. i have a matrix of row and column, panel row and panel table in jsp. my problem is how can i change the background color of a row once it clicked. i have row in table which have panel table with panel column and panel row.
    i have already work for it but i only change the background color once i clicked is the first row and first column then the rest row and column is not working..pls.. give me sample code for it..thnx a lot!!!
    Thnank's,
    froilet

    Ok! I have 2 jsp, the input jsp and display.jsp! Once i input value on input.jsp, it will display on display.jsp. I have also my javascript named updateBin.js. Now, how can i update each row once i clicked it... the succeeding rows and columns..hope u help me with this..here is my code:
    Display.jsp
    <html:html locale="true">
    <head>
         <html:base/><meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Strip Map Loader</title><script type="text/javascript" src="js/updateBin.js"></script>
    </head>
         <%      
              int intRow = Integer.parseInt(request.getParameter("intRows"));
              int intColumn = Integer.parseInt(request.getParameter("intColumns"));
              int intPanelRow = Integer.parseInt(request.getParameter("intPanelRows"));
              int intPanelColumn = Integer.parseInt(request.getParameter("intPanelColumns"));
         %>
    <BODY bgcolor="#33b9ec" leftmargin="50%">
         <b>Strip ID:  </b><font color="red" face="arial"><b><bean:write name="strStripID" scope="request" /></b></font>
         <br><br>
         <font size="3" face="tahoma"><b>Bins Updater Tool:</b></font>
         <table border="1" width="365px" bgcolor="#1ea6f7" height="15">
              <tr>
                   <td valign="top" align="center">
                        <table><tr><td><font size="2">Select Bin Type:</font></td>
                        <td><select id="binType" onchange="updateBin()" size="1">
                             <OPTION></OPTION>
                             <OPTION value="green">Good Bin</OPTION>
                             <OPTION value="red">Reject Bin</OPTION>
                        </select></td></tr></table>
                   </td>
    </tr>
    </table>
    <table id="tbl" align="center" border="1" cellspacing="3" cellpadding="5" bgcolor="#CC9900">
    <tr>
    <td>                                                  
         <%for (int pnlrows=1; pnlrows<=intPanelRow; pnlrows++){%>     
              <table id="table" width="100%" border="1" bgcolor="#CC9900" cellspacing="7" cellpadding="0" align="center">
              <tr>
              <%for(int pnlcols=0; pnlcols<intPanelColumn;pnlcols++){%>               
              <td>
                        <%for (int rows=1;rows<=intRow; rows++){%>                    
                        <table cellspacing="5" width="100px" align="center" bgcolor="#CC9900">
                        <tr>
                             <td>                    
                             <%for(int cols=1; cols<intColumn; cols++){%>
                             </td>     
                             <td id="col" bgcolor="#008000" align="center" ondblclick="changeCol()"> X </td>          
                             <%}%>
                             <td id="row" bgcolor="#008000" align="center" ondblclick="changeRow()"> X </td>
                             <td></td>     
                             <%}%>                                                  
                        </tr>
                        </table>
              <%}%>
              </td>
              </tr>
              </table>     
         <%}%>
    </td>
    </tr>
    </table>
    and this is my javascript code:
         function updateBin()
              var binType=document.getElementById("binType")
              if(binType.value == "green")
              [binType.selectedIndex].value
              //binType = changeR();
              //alert('Good Bin Selected');
              if(binType.value == "red")
              [binType.selectedIndex].value
              //binType = changeC();
              //alert('Reject Bin Selected');
              if(binType.value == "")
                   alert('Please select only on the category!')
         function changeRow()
              if(binType.value=="green")
              x=document.getElementById('row').style.background="green";     
              alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('row').style.background="red";
              //alert('Reject Bin Updated!')
         function changeCol()
              if(binType.value=="green")
                   x=document.getElementById('col').style.background="green";     
                   alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('col').style.background="red";
              //alert('Reject Bin Updated!')
    this code only updates the first row and column..but the succeeding panel row and panel column can't update...what will i do? theres something wrong in my javascript or in my jsp...pls help me......thanx.....in advance!!

  • How to access specific row of a database table.

    hi all,
    i am saving all the hr tables in a internal table.
    say, mtable = 'pa0002'  is the content of mtable on looping above internal table.
    LOOP AT i_itf_list INTO wa_list.  "wa_list contains list of hr tables.
       mtable = wa_list-tabname.
       LOOP AT persno.  "persno contains list of personal numbers.
    "how to acess particular row of (mtable)  dynamically where pernr = persno-pernr."
       ENDLOOP.
    ENDLOOP.
    thanks.

    Hi,
    Use below code for your reference.
    data : ref_table_des type ref to cl_abap_structdescr,
              dref type ref to data.
    field-symbols : <itab> type standard table,
                            <wtab> type any.
    data : mtable type tabname.
    LOOP AT i_itf_list INTO wa_list. "wa_list contains list of hr tables.
    clear mtable.
    mtable = wa_list-tabname.
    LOOP AT persno. "persno contains list of personal numbers.
    ref_table_des ?= cl_abap_typedescr=>describe_by_name( mtable ).
    create data dref type handle ref_table_des.
    assign dref->* to <wtab>.
    create data dref like standard table of <wtab>.
    assign dref->* to <itab>.
    ***if you want to select multople rows use below select***********
    select * from (mtable)
    into table <itab>
    where pernr = persno-pernr.
    ********if you want to select single row use below select************
    select single * from (mtable)
    into <wtab>
    where pernr = persno-pernr.
    ENDLOOP.
    ENDLOOP.
    Vijay

  • How to find a row of a table

    I create VO, EO, AM. I create a form based on VO. It shows the data of the first row. How to set the AM that the form can shows a specific row?
    For example, after adding some code (set getting the 5th row) in AM, the form can show the data of the 5th row.
    Can I do that? If I can, how to write the code? Please past the detail steps, code sample and tutorial address.
    Thanks a lot.

    this might help
    *028.     How-to scroll an ADF bound ADF Faces Table using a Keyboard Shortcut*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • How to select specific rows in rtf template for complex calculation

    Hi,
    I want custom calculation in my rtf template and for this i need to select specific cell's value OR specific row's value. Any one please suggest how can I get this. Below is the example i have plotted using excel. My target is to get field 8 and 9 using sum and minus. We can calculate column over column, is there any way to calculate row over row? If I use variables, then i have to create so many variables because I have more columns and rows to calculate (here i posted one sample table). Any one please help me how can I get expected result other than using variables! If "Using variables" is the only way then also give your valuable opinions.
    Row No
    Curr Qtr
    PQtr1
    PQtr2
    3
    B3
    C3
    D3
    4
    B4
    C4
    D4
    5
    B5
    C5
    D5
    6
    B6
    C6
    D6
    7
    B7
    C7
    D7
    8
    B8=SUM(B4:B7)
    C8=SUM(C4:C7)
    D8=SUM(D4:D7)
    9
    B9=B8-B5
    C9=C8-C5
    D9=D8-D5
    Thanks.

    Hi AlexAnd,
    Thanks for the reply, I got 0 using both codes. This is a dummy table and I plotted 3,4 to give an idea of row number (as like as excel). Rows are individual data sets combining different measures and dimensions with different values.
    Account
    Curr_Qtr
    PQtr1
    PQtr2
    Deposit
    10
    15
    20
    Loan
    15
    20
    25
    Earning
    20
    25
    30
    Assets
    25
    30
    35
    Total
    =SUM(15,20)
    =SUM(20,25)
    =SUM(25,30)
    Expense
    =SUM(15,20)-25
    =SUM(20,25-30
    =SUM(15,20)-25
    Is there any way to identify the range or individual cell's value? Using variables I have to create lots of variables for each cells, I want to avoid that and want to use rows in calculation! Is that possible, Pls share your valuable opinions!
    Thanks.

  • How to colour specific rows within an WebDynpro ALV

    Hi everyone,
    I need to colour only specific rows of an ALV. I've already scoured sdn and implemented the solutions that I found but none of them seems to be working okay.
    I have an ALV table and I want to highlight only a few rows based on a certain logic.
    I've defined a context node that defines 2 attributes: textview_design and cell_design.
      LOOP AT ft_out_purchase_order_temp INTO ls_out_purchase_order_temp.
      if ....
        ls_out_purchase_order_temp-textview_design =  cl_wd_text_view=>e_design-standard.
        ls_out_purchase_order_temp-cell_design = cl_wd_table_column=>e_cell_design-standard.
      else.
          ls_out_purchase_order_temp-cell_design =  cl_wd_table_column=>e_cell_design-total.
          ls_out_purchase_order_temp-textview_design =  cl_wd_text_view=>e_design-emphasized.
      endif.
    ENDLOOP.
      lr_column_settings ?= po_alv_config_table.
      lr_column = lr_column_settings->get_column( 'EBELN' ).
      lr_column = po_alv_config_table->if_salv_wd_column_settings~get_column( 'EBELN' ).
      lr_column->set_cell_design_fieldname( value = 'CELL_DESIGN' ).
    This code works but the thing is that the whole column named 'EBELN' is coloured light green. This is strange because I've instructed the system that the design of the column EBELN is controlled by the field CELL_DESIGN and this field has the following values:
    10    (light green)
    33    (light blue)
    10
    10
    10
    33
    10
    33
    Any ideas?

    Hii,
       To color a particular row you need to follow two things.
    1. Specify condition based on which the row will be colored i.e. set the value for the attribute 'CELL_DESIGN'.
    2. Get all column references and  set the cell design field name with 'CELL_DESIGN'.
    Get all column reference.
    DATA : LT_COLUMNS TYPE SALV_WD_T_COLUMN_REF,
                 LS_COLUMNS TYPE SALV_WD_S_COLUMN_REF.
      LT_COLUMNS = LR_COLUMN_SETTINGS-&gt;GET_COLUMNS( ).
    configure column
      LR_COLUMN_SETTINGS ?= LV_VALUE.                              " column functions
      LT_COLUMNS = LR_COLUMN_SETTINGS-&gt;GET_COLUMNS( ).
    set cell design for all.
    In your case if a single column is getting colored the then the reason might be
    1.every record satisfying your if condition specified.
    2.you have set cell design in that particular field name.
    Regards,
    Monishankar C

  • How to color a row using REUSE_ALV_HIERSEQ_LIST_DISPLAY

    Hi,
    I'm able to color a row using REUSE_ALV_GRID_DISPLAY, I tried the same way to color a row at the item level using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' but I'm not able to get the row color, please let me know how to acheive this.
    Thanks in Advnce
    Narayan

    you need to do 4 things.
    1. Add a field in your final internal table which ur going to display.
    2.Name the field as----
    > color_line(4)   TYPE  c,
                begin of itab,
                              matnr            type  mara-matnr,
                              ernam          type  mara-ernam,
                           color_line(4)   TYPE  c,
               end of itab.
    3.declare layout ....................> data :  it_layout   TYPE lvc_s_layo.
    4. After filled your fieldcat and before display your ALV
            loop at itab assigning to <itab>.
                          if <itab>-ernam eq 'XYZ'.
                          <itab>-color_line = 'C600'.
           end loop.
    it_layout-info_fname = 'COLOR_LINE'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    exporting
        IS_LAYOUT                      = it_layout
        IT_FIELDCAT                    = your_fieldcat
      and pass ur  ITAB.

  • How can I delete rows in a table from the bottom?

    I have table that I add rows to and I want to remove rows starting with the last row. For example if I have a table with 20 rows how do I remove rows 16-20. I can't figure out how to do this.

    The following script would/should/might delete the last 4 rows of a subform named 'itemsSub' : (or actually deletes the last row 4 times hopefully!)
    for (var f = 0; f<4; f++)
    _itemsSub.removeInstance(itemsSub.all.length - 1);

  • How to delete a row in ADF Table by pressing "Delete" Key

    I want to delete a row in my ADF table by pressing the "Delete" key..How can i achieve it?

    hai ,
    I write clientListener and ServerListener..But in the script i printed the event.getKeyCode() ...*When i press Delete Key or EnterKey ,it is not printing the value*..
    The code i write is pasted below..
    In the code backing_Comm is my backingbean..Is there any problem in the code that i had written?I want to delete a selected row from my table using keypress Event...pls advice..
    <script type="text/javascript">
    onPressDeleteKey=function(event){
    alert(event.getKeyCode()); // *Here i am not getting the alert, when i press Delete Key or Enter Key..But getting alert when i press A- Z or 1 - 0*
    if(event.getKeyCode()==AdfKeyStroke.ENTER_KEY) {
    var source = event.getSource();
    AdfCustomEvent.queue(source,performDeleteOnPress,{},false);
    </script>
    <*af:table* value="#{bindings.ComMastVO.collectionModel}"
    var="row"
    rows="#{bindings.ComMastVO.rangeSize}"
    emptyText="#{bindings.ComMastVO.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.CompMastVO.rangeSize}"
    rowSelection="single"
    id="tblCom"
    columnStretching="last" inlineStyle="width:100%;"
    width="273"
    selectionListener="#{backing_Comm.rowSelectCom}"
    binding="#{backing_Comm.tblCom}"
    clientComponent="true" >
    <*af:column* sortProperty="Com" sortable="true">
    <*af:inputText* value="#{row.bindings.Com.inputValue}"
    label="#{bindings.ComMastVO.hints.Com.label}"
    required="#{bindings.ComMastVO.hints.Com.mandatory}"
    columns="150"
    maximumLength="#{bindings.ComMastVO.hints.Com.precision}"
    shortDesc="#{bindings.ComMastVO.hints.Com.tooltip}">
    valueChangeListener="#{backing_Comm.onValueChange}"
    autoSubmit="true" >
    <f:validator binding="#{row.bindings.Com.validator}"/>
    *</af:inputText>*
    *<af:serverListener type="performDeleteOnPress"*
    *method="#{backing_Comm.goDeleteCurrentRow}"/>*
    </af:column>
    *<af:clientListener type="keyPress"*
    *method="onPressDeleteKey"/>*
    </af:table>
    =================================================
    anybody pls help??
    Edited by: Briston Thomas on Jun 3, 2009 2:25 AM

Maybe you are looking for

  • AirPrint not working with iOS 5 ...

    Prior to upgrading my iPhones and iPads to iOS5 I was able to wirelessly print to my printer which is attached to my iMac (OSX 10.6.8).  A while back, someone on this discussion board posted the following script to run on the iMac to enable AirPrint.

  • Is there a cable adapter that will let me turn a Thunderbolt slot into a 3.0 slot?

    I have an older iMac and the usb slots are all 2.0.  Is there an adapter that will plug into a Thunderbolt slot and let me get full speed from a usb 3.0 drive?

  • Previously deleted emails being sent to my phone

    Replaced my old 3gs with a new 4. Set up my email account (BT). Started to get old, previously deleted emails being sent to my phone. Hundreds of the things. Please help.

  • Regarding ABAP/4 Keywords

    Hi All, I want Know How to maintain ABAP/4 Key words in TSE05.Kindly help me out. Thanks& Regards, Ramya Sudha

  • "Timed out" Cannot connect to internet

    Hello, As of this morning, I cannot connect to the internet. I checked with the internet provider but all systems go. It is slow and particlly will open. For example it will either time out or get to display an internet page but will not fully open s