ALV cell alignment

Hi,
I want to make cell alignment in ALV.
I could able to do left and center alignment but not right alignment.
How to do the right alignment??
I'm using the below code:
data lr_salv_column      type ref to cl_salv_wd_column.
lr_salv_column->SET_H_ALIGN( value = 1 ). "0 - right/ 1- center
Thankx,
Suba

Jatra Riwayanto wrote:>
> Hi,
>
> .....
> * set h.alignment
>   LR_COL->SET_H_ALIGN( '06' ).
>  
>    
>
> Notes:
> '06' = FORCED RIGHT
> '05' = END OF LINE
>
> Regards,{quote}
Just a word of warning.  You should avoid coding the values directly.  SAP can change these values at any time and we won't applogize if that breaks your application. :)  You should always use the class constants.  This also makes your coding much more readable and maintainable.  It also makes it easy to forward navigate and find all the possible values.  For this example the class constants are CL_WD_TABLE_COLUMN=>E_H_ALIGN
Type defintion from CL_WD_TABLE_COLUMN:
begin of e_h_align,
      auto type wdy_uie_library_enum_type value '00', " TableColumnHAlign.auto
      center type wdy_uie_library_enum_type value '01', " TableColumnHAlign.center
      forced_left type wdy_uie_library_enum_type value '04', " TableColumnHAlign.forcedLeft
      end_of_line type wdy_uie_library_enum_type value '05', " TableColumnHAlign.endOfLine
      forced_right type wdy_uie_library_enum_type value '06', " TableColumnHAlign.forcedRight
      begin_of_line type wdy_uie_library_enum_type value '07', " TableColumnHAlign.beginOfLine
    end of e_h_align .
So your coding should be:
LR_COL->SET_H_ALIGN( CL_WD_TABLE_COLUMN=>E_H_ALIGN-FORCED_RIGHT ).

Similar Messages

  • J Table - Single Cell Alignment

    Hello everyone,
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.util.Random;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumnModel;
    public class RowColorTest
        private JTable table;
        public static void main(String[] args)
            new RowColorTest();
        public RowColorTest()
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createGUI();
        public void createGUI()
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            String[] columnNames = new String[4];
            columnNames[0] = "Name";
            columnNames[1] = "Age";
            columnNames[2] = "Value";
            columnNames[3] = "Extra";
            Object[][] data = new Object[20][4];
            Random r = new Random();
            for(int a=0; a < 4; a++)
                for(int i=0; i < 20; i++)
                    if(i == 0 || i == 5 || i == 10 || i == 15)
                        data[i][a] = 23;
                    else
                        data[i][a] = r.nextInt(50);
            DefaultTableModel model = new DefaultTableModel(data, columnNames);
            table = new JTable(model)
                public boolean isCellEditable(int rowIndex, int vColIndex)
                    return false;
                public Class getColumnClass(int column)
                    return getValueAt(0, column).getClass();
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    TableColumnModel tcm = table.getColumnModel();
                    Object result = getValueAt(row, tcm.getColumnIndex("Value"));
                    if(result instanceof Integer)
                        if(((Integer) result) == 23)
                            c.setBackground(new Color(0, 255, 153));
                            c.setForeground(Color.BLACK);
                            if(column == 0)
                                    // I would like to do a CELL ALIGNMENT for this particular condition.
                                    // setHorizontalAlignment() does not exist for the object c (Component).
                        else
                            c.setBackground(Color.WHITE);
                            c.setForeground(Color.BLACK);
                            if(column == 0)
                                    // I would like to do a CELL ALIGNMENT for this particular condition.
                                    // setHorizontalAlignment() does not exist for the object c (Component).
                    if(table.isRowSelected(row))
                        c.setBackground(Color.BLUE);
                        c.setForeground(Color.WHITE);
                    return c;
            JPanel panel = new JPanel();
            JScrollPane sp = new JScrollPane(table);
            panel.add(sp, BorderLayout.CENTER);
            frame.setContentPane(panel);
            frame.pack();
            frame.setVisible(true);
    }Sorry for bringing this up again, but I am having a hard time trying to "align" a single "cell". In the code that I have provided, I tried to find a method from the Component object for setHorizontalAlignment() hoping to make this call:
    c.setHorizontalAlignment(SwingConstants.RIGHT);
    However, it does not exist. How would I go about setting the alignment for an individual cell? I've searched the forum for "cell alignment" and found some information about using a DefaultTableCellRenderer, but I'm not sure how to merge that with the existing code that I currently have.
    In this thread: http://forums.sun.com/thread.jspa?forumID=57&threadID=659910 , camickr pointed out that I can use the row and column variables to find which cell to align, however once I've found the particular cell that I'd like to align, what do I do next? The component c does not have a method to set alignment in this scenario.
    Thanks again,
    Brianiak

    You - the programmer - know that the component in question will be a label of some kind. The compiler, however, does not. As far as javac is concerned, the component could be, say, a 3D animation, in which case setHorizontalAlignement would be illegal.
    In order to share our runtime knowledge with the compiler, we have to use some explicit casting:
    (JLabel)c.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);Note that this will lead to runtime errors if our component is not an instance of JLabel, so it's a good idea to surround the code with:
    if (c instanceof JLabel){
    }

  • ALV cells as buttons

    Hello,
    I'm using attribute cl_gui_alv_grid=>mc_style_button to put some cells in my ALV as buttons. I need that when the user push those buttons an event is raised. Does someone have any example of buttons in ALV cells?
    Thank you and regards.

    Hello,
    I'm using attribute cl_gui_alv_grid=>mc_style_button to put some cells in my ALV as buttons. I need that when the user push those buttons an event is raised. Does someone have any example of buttons in ALV cells?
    Thank you and regards.

  • Alv cell color with FM

    hi ,
    can one send me program for alv cell color with help of function modules
    kiran

    Hi Kiran .
    <b>1.Cell Color.</b>
    While Building Fieldcatalog ,there is one field called
    EMPHASIZE.You have to set like this .
    i_field-emphasize = 'C26'.
    <b>2.ROW COLOR.</b>
    Have a look at this example .
    <b>a</b>.Define one variable COLOR in ur main ITAB.
    <b>b</b>.Fill it .
    <b>c</b>.Pass this info.
      w_layout-info_fieldname = 'COLOR'.
    <b>d</b>. display it .
    *& Report  ZGRID_COLOR                                                 *
    REPORT  zgrid_color                             .
    TYPE-POOLS slis.
    DATA: BEGIN OF i_pa0001 OCCURS 0,
    <b>        color(3) TYPE c,</b>
            pernr TYPE pa0001-pernr,
            subty TYPE pa0001-subty,
          END OF i_pa0001.
    DATA :i_field TYPE slis_t_fieldcat_alv,
          w_field LIKE LINE OF i_field,
          w_layout TYPE slis_layout_alv.
    START-OF-SELECTION .
      PERFORM get_data.
      PERFORM fieldcat.
      PERFORM layout_build.
      PERFORM dispaly .
    *&      Form  fieldcat
    FORM fieldcat .
      CLEAR :w_field,i_field[].
      w_field-fieldname = 'PERNR'.
      w_field-tabname   = 'I_PA0001'.
      w_field-seltext_m = 'PERNR'.
      APPEND w_field TO i_field.
      CLEAR w_field.
      w_field-fieldname = 'SUBTY'.
      w_field-tabname   = 'I_PA0001'.
      w_field-seltext_m = 'SUBTY'.
      APPEND w_field TO i_field.
      CLEAR w_field.
    ENDFORM.                    " fieldcat
    *&      Form  dispaly
    FORM dispaly .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = 'ZGRID_COLOR'
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
    <b>   is_layout                         = w_layout</b>
       it_fieldcat                       = i_field
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = i_pa0001
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " dispaly
    *&      Form  get_data
    FORM get_data .
      SELECT pernr subty
      FROM pa0001
      INTO CORRESPONDING FIELDS OF TABLE i_pa0001
      UP TO 10 ROWS.
    LOOP AT i_pa0001.
        IF sy-tabix GT 5.
      <b>    i_pa0001-color = 'C51'.</b>
          MODIFY i_pa0001 INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " get_data
    *&      Form  layout_build
    FORM layout_build .
    <b>  w_layout-info_fieldname = 'COLOR'.</b>
    ENDFORM.                    " layout_build
    I hope it helps u .
    <b>Thanks,
    Venkat.O</b>

  • Set ALV Cell visibility property

    Hi,
    I would have 2 tables for ALV. One table consists of the data to be bound to the ALV. The other table would have the read only property(boolean) filled for each of the ALV cells.
    I would want to set the property of each ALV cell using the second table. How do i do that?
    Currently i am just testing it for few attributes statically using the below code.
    DATA lo_nd_date_table TYPE REF TO if_wd_context_node.
    DATA lo_el_date_table TYPE REF TO if_wd_context_element.
    DATA: lt_ele_set TYPE wdr_context_element_set.
    navigate from <CONTEXT> to <DATE_TABLE> via lead selection
      lo_nd_date_table = wd_context->get_child_node( name = wd_this->wdctx_date_table ).
    lt_ele_set = lo_nd_date_table->get_elements( ).
      LOOP AT lt_ele_set INTO lo_el_date_table.
          lo_el_date_table->set_attribute_property(
               attribute_name = 'WK02'                                 -
    > Attribute Name (Column Name)
               property       = if_wd_context_element=>e_property-read_only
               value          =  'X' ).
    << Similarly for other attributes>>
    ENDLOOP.
    I have inserted this code at the end. Initially few other properties were set to the cells.
    This seems to be not working.
    Regards,
    Rekha
    Edited by: Rekha Gopinath on Sep 8, 2009 10:40 AM

    Hi Lekha,
    In my case, the columns represents dates. The rows represent projects. So, only those row cells are editable where the project is valid.
    1. I have created READ_ONLY attribute for the date node (table).
    2. I am filling the READ_ONLY to abap_true or abap_false based on the following condition.
       Even if one of the projects is not valid for a date, then READ_ONLY = ABAP_TRUE. This means, even if one cell is set to abap_true, then READ_ONLY is set to abap_true.
    3. I modify the date node and bind it with the READ_ONLY set row wise.
    Loop at the data and set read only
      navigate from <CONTEXT> to <DATE_TABLE> via lead selection
      lo_nd_date_table = wd_context->get_child_node( name = wd_this->wdctx_date_table ).
      CALL METHOD lo_nd_date_table->get_static_attributes_table
        IMPORTING
          table  = lt_date_table    .
      LOOP AT lt_date_table INTO ls_date_table.
        lv_tabix = sy-tabix.
          READ TABLE wd_this->gt_prop INTO ls_prop INDEX lv_tabix.
          IF sy-subrc EQ 0.
            IF ls_prop-wk01 = abap_true OR         
              ls_prop-wk02 = abap_true OR
              ls_prop-wk03 = abap_true OR
              ls_prop-wk04 = abap_true OR
              ls_prop-wk05 = abap_true OR
              ls_prop-wk06 = abap_true OR
              ls_prop-wk07 = abap_true OR
              ls_prop-wk08 = abap_true OR
              ls_prop-wk09 = abap_true OR
              ls_prop-wk10 = abap_true OR
              ls_prop-wk11 = abap_true OR
              ls_prop-wk12 = abap_true OR
              ls_prop-wk13 = abap_true OR
              ls_prop-wk14 = abap_true OR
              ls_prop-wk15 = abap_true.
              ls_date_table-read_only = abap_true.
            ELSE.
              ls_date_table-read_only = abap_false.
            ENDIF.
          ENDIF.
        MODIFY lt_date_table FROM ls_date_table INDEX lv_tabix TRANSPORTING read_only.
      ENDLOOP.
      CALL METHOD lo_nd_date_table->bind_table
        EXPORTING
          new_items            = lt_date_table
          set_initial_elements = abap_true.
    4. I loop through the column reference and use the code mentioned earlier.
              CREATE OBJECT lr_input
                EXPORTING
                  value_fieldname = lv_id.
              lo_column->set_cell_editor( value  = lr_input ).
              lr_input->set_read_only_fieldname( value = 'READ_ONLY' ).
    The expected output is different from the input i had mentioned earlier for Row 1, row 2, Row 3 and row 4. Here, i would get all the rows as non editable except for Row 3.
    I would want to set all columns based on condition.
    Regards,
    Rekha

  • Wrap text in ALV cell

    Hello,
    I have an ALV table, and some colums are of type text with quite long lengths.
    Initially the columns have a small length, but when the user writes long texts (for example 100 characters) the cell will is automatically enlarged to show the complete text on the screen. That's quite annoying because with two or three columns like this, storing long texts, the overall width of the table is really big.
    I know that there is a way to define fixed columns, but the problem with this is that then, when the long text is input in the table, you cannot scroll inside the cell to see the values, you can only see the beginning of the phrase.
    I would like to do something similar to the Excel. First I would like to allow the users to resize the columns (just like the Excel grid) and then I would like to wrap long texts in different rows (inside the cell) to reduce the cell width.
    Is this possible? What would you recommend in this case?
    Regards

    Hi Javier,
    The ALV resize functionality is there in 7.0 Enhp1. It works for standard tables and ALV. You only have to set the fixedTableLayout property to True.  You can use the below link to check out Thomas Jung's [demonstration |http://www.flickr.com/photos/tjung/2806011790/]in which he shows as to how we can resize the ALV columns.
    create an instance of ALV component
    DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
    LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
    LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
    LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
    LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
    IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
    LR_CMP_USAGE->CREATE_COMPONENT( ).
    ENDIF.
    get reference to the ALV model
    LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
    LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).
    LR_TABLE_SETTING ?= LR_CMDL.
    Set column width
    DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
    LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
    LR_COL->SET_WIDTH( '70' ) .
    LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ENAME' ).
    LR_COL->SET_WIDTH( '100' ) .
    LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
    Regards,
    Uday

  • ALV cell attributes CHANGE during DATA_CHANGED event

    Hi,
    I am working with CL_GUI_ALV_GRID in a splitter control. I am trying to make separate cells (non)editable depending on user input in the ALV. In event DATA_CHANGED (refefined) I change the cellstyle-table and then use method REFRESH_TABLE_DISPLAY.
    My problem is: I can change contents of fields perfectly, but when I change a cell's editability, the cell is being showns as editable, but when I press F4 f.i. and look in debug, the cellstyles-table hasn't been updated and still reflects the old values.
    Could anybody help me out?
    Kind regards,
    Roy
    P.S. Obviously I will reward points to useful answers.

    Hi Nithya,
    I am not making the field edit or no-edit using fieldcatalog-edit. This makes an emtire column editable. I only want to make individual cells editable.
    I do this using a table that I have attached to the ALV's structure and linked using layout-stylefname. You gave me an idea though: I might have to use SET_SELECTED_CELLS or an equivalent.
    Any other ideas that might be helpful?
    Kind regards,
    Roy

  • OO ALV Cell Merge Problem when editable fields

    Hi there!
    I'm using OO ALV ( CL_GUI_ALV_GRID ) and experiencing a strange problem.
    I'm interested in the cells merging functionality of ALV, when i sort data for a specific field.
    It works fine but only if i do not set any field as editable ( lvc_s_fcat-edit = 'X' ).
    For some reason ALV loses some of its functionality when you set a field as editable.
    I've noticed it also with the functionality of expanding/supressing data when using subtotals.
    If any field is set as editable then subtotals come always expanded, you cannot supress them...
    Has anyone else experienced somethng like this before? Any help will be appreciated!
    BR
    George Zervas

    Hi,
    Check This [Thread|http://forums.sdn.sap.com/thread.jspa?threadID=928573]  to solve your issue.
    Check the  User Command, first line should be call method cl_gui->check_changed_data().
    Check this [url|http://wiki.sdn.sap.com/wiki/display/ABAP/InteractiveEditableOOALVgridwithdynamicitab,FCATandENTERkeyeventtrigger] for code to work on Interactive Editable OO ALV grid .
    Hope will solve your issue.
    Regards,
    Saravana.S
    Edited by: saravanasap on Feb 14, 2012 7:38 AM

  • How to avoid roundtrip to server on value select in dropdown box in ALV cel

    Dear Experts,
    I have WD ALV table where user edits values in the cels using dropdown by key element.
    Then after edit he saves whole table. When value is changed in dropdown box the roundtrip to server occurs and it takes noticable time for every cell. My dropdown lists are fixed and are the same for all rows. It is not pleasant user experience and is annoying for user.
    Is there a way to disable this roundtrip for each value selection for each cell and transfer all the data for whole ALV table only when I save whole table (separate button "Save")?
    Help very much appreciated.
    Dmitry

    A lot of enterprises, however, actively avoid systems which are locked down to a particular server for very legitimate reasons. If my data center dies in the middle of the night, I sure don't want to have to call your mobile phone so that you can get to a computer, log in to the office network, and get me a new key so that I can finish my emergency failover. If I've got dozens of applications, I absolutely don't want to do that with dozens of different vendors.
    It sounds like your problem, though, isn't that users are installing your software on multiple computers it's that they are accessing functionality they haven't licensed. That is generally a much easier problem to solve and doesn't require you to lock anything down to a particular machine. You can create a table LICENSED_CONTENT, for example,
    CREATE TABLE licensed_content (
      client_id    NUMBER,
      content_type VARCHAR2(30),
      key          RAW(128)
    )In this case, KEY is, say, a hash (using the DBMS_CRYPTO or DBMS_OBFUSCATION_TOOLKIT packages if you'd like) of the client_id, content_type, and a bit of salt (i.e. a fixed string that only you know). When you sell a license to manage diamond content, you provide a script that inserts the appropriate row in the LICENSED_CONTENT table. When your application starts up, it reads the LICENSED_CONTENT table and verifies the hash before allowing users to access that type of content. This allows legitimate customers to move the software from one system to another but prevents them from accessing new functionality without a new license.
    Justin

  • Doctypes & Cell Alignment

    Certain doctypes, especially the more recent ones, inherit
    alignment in a
    cell from the ones they're nested in. For instance :
    <table>
    <tr>
    <td align="right">
    <table>
    <tr>
    <td>
    Test
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    Table will be right-aligned, even though it's in a cell
    that's set to
    default (nothing). Old behavior was that this would
    automatically
    left-align. New behavior is that all nested tables will
    inherit the
    alignment of the outer table.
    Isn't that terribly inefficient? The most common use is
    left-alignment. The
    new way (I forget which doctype it is) forces me to add align
    tags to
    left-justify everything. That can amount to a significant
    amount of
    unnecessary code.
    What's the recommended thing to do in this case?

    <div style="width:200px;background-color:#CCC;">
    <p style="margin:0 auto;">Title Goes Here</p>
    <form id="form1" method="post" action=""
    style="margin:0;padding:0;">
    <div style="width:50%;float:left;">
    <input type="checkbox" name="checkbox" value="checkbox"
    id="checkbox"
    style="float:left;clear:left;" />
    <label for="checkbox"
    style="float:left;margin-left:3px;width:60px;">Option
    1</label>
    <input type="checkbox" name="checkbox2" value="checkbox"
    id="checkbox2" style="float:left;clear:left;" />
    <label for="checkbox2"
    style="float:left;margin-left:3px;width:60px;">Option
    2</label>
    </div>
    <div style="width:50%;float:left;">
    <input type="checkbox" name="checkbox3" value="checkbox"
    id="checkbox3" style="float:left;clear:left;" />
    <label for="checkbox3"
    style="float:left;margin-left:3px;width:60px;">Option
    3</label>
    <input type="checkbox" name="checkbox4" value="checkbox"
    id="checkbox4" style="float:left;clear:left;" />
    <label for="checkbox4"
    style="float:left;margin-left:3px;width:60px;">Option
    4</label>
    </div>
    </form>
    <hr
    style="height:0;line-height:0.0;font-size:0;margin:0;padding:0;visibility:hidden;clear:bo th"
    />
    </div>
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "R. Jay" <[email protected]> wrote in message
    news:[email protected]...
    > "Murray *ACE*" <[email protected]>
    wrote in message
    > news:[email protected]...
    >>
    >> Stop using tables! 8)
    >
    > I've wanted to, believe me... but every time I
    approached even the most
    > basic table-like task, the same people who urged me to
    go all-div/all-css
    > just told me I couldn't do this, couldn't do that...
    honestly, if it can't
    > do what tables can do, why do people keep saying to drop
    tables? ;)
    >
    > I'll give you an example :
    >
    > <table bgcolor="#CCCCCC">
    > <tr>
    > <td colspan="2">Title goes here </td>
    > </tr>
    > <tr>
    > <td width="50%" valign="top"><table border="0"
    cellspacing="0"
    > cellpadding="0">
    > <tr>
    > <td><input type="checkbox" /></td>
    > <td>Option 1 </td>
    > </tr>
    > <tr>
    > <td><input type="checkbox" /></td>
    > <td>Option 2 </td>
    > </tr>
    > </table></td>
    > <td width="50%" valign="top"><table border="0"
    cellspacing="0"
    > cellpadding="0">
    > <tr>
    > <td><input type="checkbox" /></td>
    > <td>Option 3 </td>
    > </tr>
    > <tr>
    > <td><input type="checkbox" /></td>
    > <td>Option 4 </td>
    > </tr>
    > </table></td>
    > </tr>
    > </table>
    >
    > Paste this in DW and look at what it is, and what it
    does. The simplest of
    > tables. A title cell, two columns, and two checkbox
    options per column.
    >
    > Advantages :
    > - valign=top ensures that if one column goes to 3 or
    more options, the
    > other remains top-justified.
    > - width=50% ensures that no matter how big one of the
    column gets, the
    > other is just as big (symmetry).
    > - The background color covers the entire thing, no
    matter how tall or wide
    > it is, but I can also color each individual option row
    > - Using nested tables means that if the outer table is
    in a confined area,
    > and the option names are too long than the column will
    allow, it will wrap
    > to the right of the checkbox - not under it.
    > - Everything is relative, not absolute... I can add
    anything I want above
    > or below this table, and nothing will need re-adjusting.
    > - Fonts can go bigger or smaller and the table will
    adjust.
    > - etc.
    >
    > Could you send me code that will do all of the above and
    be just as easy
    > for me to edit in DW? If so, you may have a convert on
    your hands. Using
    > as few chrs as possible, send it to me the same way I
    just sent you this
    > one, and I will paste it in DW and study it closely.
    It's by comparing the
    > two models side by side that I will be able to finally
    leave tables
    > behind.
    >
    > But so far, everytime I've asked someone about whatever
    obstacles I ran
    > into using divs and layers, they had no idea how to
    solve it. That turned
    > me off to the idea of leaving tables behind. That's why
    seeing a
    > functional example -- instead of endless tutorials --
    would get me to
    > consider the idea seriously again... enough to get my
    nose into those
    > tutorials.
    >

  • Table Cell Alignment

    Is it possible to establish default alignments for different cells in a table?  I have a table with 13 columns.  I would like to be able to set the default alignment to "center" in all columns but two.  I wish the second column to have a default alignment of "right" and the third column to have a default alignment of "left".  Then when I copy data from an excel spreadsheet into the table, I would like these alignments to be maintained.
    Thanks in advance for any help you can provide!
    Greg

    Gregory Kush wrote:
    Is it possible to establish default alignments for different cells in a table?  I have a table with 13 columns.  I would like to be able to set the default alignment to "center" in all columns but two.  I wish the second column to have a default alignment of "right" and the third column to have a default alignment of "left".  Then when I copy data from an excel spreadsheet into the table, I would like these alignments to be maintained.
    Thanks in advance for any help you can provide!
    Greg
    Can you do what you are asking easily, sure with CSS it's a fairly easy task.  Copying and pasting from Excel, this gets discussed very often and it's not a pretty process.  First because Excel does not Export HTML well at all, and XML exporting in Excel is not an easy task to set up, but once it's setup it can be a viable workflow.
    CSS Tutorial - http://www.w3schools.com/CSS/
    Basically you define a class or ID to your table and another class to text align left.  So you do something like this:
    CSS
    .center-text { text-align: center; }
    .left-text { text-align: left; }
    .right-text { text-align: right; }
    <table class="center-text"><tr><td> // that will center everything in the table.
    Then for the right align and left align just apply the respective class to the cell (this can also be done through properties window by using the drop-down menu to select the class).  If you are using XML or populating this information from a database can just run a loop to populate the data, and you can also use that same query to populate Excel for reporting if you wish to go that route.

  • JTable = Cell Alignment

    Is it possible to centre align data in a JTable cell? If possible, where can I see how to do so.
    Thx

    Here's an article that should help:
    http://www-106.ibm.com/developerworks/java/library/j-jtable/index.html?dwzone=java

  • Cell alignment problems

    hi, im currently working on a website with dreamweaver, its
    only the 2nd html site ive ever made.
    both sites have been photography portfolios, so involve
    thumbnailed galleries. i figured it would be easiest to use tables
    to create the pages, as the the images are different sizes (some
    landscape, some portrait etc). i used css for properties of cells.
    problem is, when i move from one page to another in the
    browser (seems to be every browser, but some are worse than
    others), the cells appear to move. some of them have borders so
    this is quite obvious.
    am i missing something glaringly obvious? i find it so
    frustrating, i have tried adjusted the cell widths through css and
    single cell properties but neither seem to make the slightest
    difference. it appears the content that is in each cell determines
    the width of it in the browser, how can i control this so i can
    maintain uniform alignment throughout the site?
    many thanks in advance for any advice whatsoever

    With a single table like that, you'll experience the size
    shifts. You
    may want to use a single nested table for the content.
    Outer table - 3 rows
    top row, colspan 2
    middle row, thin left cell for navbar, wide right cell to
    hold nested table
    bottom row, colspan 2
    Set explicit widths for the middle row cells.
    In the middle row right cell, place a nested table with the
    page content.
    Another option is to go "tableless" and just use CSS for the
    layout.
    (PS - I didn't even notice the buttons on the left for a
    while. I stared
    dumbly at the page wondering how to get to the next page. The
    buttons
    are so dim they are difficult to see against the black
    background.
    Depending on the angle of my LCD screen, sometimes they
    disappear entirely.)
    Alec
    Adobe Community Expert

  • Cell alignment in JTreeTable

    hi,
    how can i set alignment of a cell in a JTreeTable?

    i have the following renderer :
    public class TreeTableCellRenderer extends JTree implements TableCellRenderer,SwingConstants
    protected int visibleRow;
    public TreeTableCellRenderer(TreeModel model) {
    super(model);
    public void setBounds(int x, int y, int w, int h) {
    super.setBounds(x, 0, w, JTreeTable.this.getHeight());
    public void paint(Graphics g) {
    g.translate(0, -visibleRow * getRowHeight());
    super.paint(g);
    public Component getTableCellRendererComponent(JTable table,
    Object value,
    boolean isSelected,
    boolean hasFocus,
    int row, int column) {
    if(isSelected)
    setBackground(table.getSelectionBackground());
    else
    setBackground(table.getBackground());
    visibleRow = row;
    return this;

  • Cell Alignment

    Hello folks, does anyone knows why and how to fix
    a this problem ?
    On Dreamweaver CS4, my text shows on the bottom left, but when
    I display the page on IE8, the text shows on the top left on the cell.
    Thanks

    For what I see ( align="left" valign="bottom ) it should display as bottom line to the left of the cell.
    However that's not the case with Internet Explorer 8 as you can see on the pict.
    Here is the code:
    <body bgcolor="#424242" text="#FFFFFF" onload="fillScreen();" >
    <table width="975" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="640" align="left" valign="bottom"><img src="../GEPICS/GEM01.JPG" width="596" height="50" /></td>
        <td width="3460" align="left" valign="bottom"><p class="TEXT"><strong> You may Drag the Map<br />
           with the Left Mouse Button</strong></p></td>
      </tr>
      <tr>
        <td colspan="2" align="left" valign="bottom"><img src="../GEPICS/GEM02.jpg" width="950" height="6" /></td>
      </tr>
      <tr>
        <td colspan="2" align="left" valign="bottom"><div class="pancontainer" data-orient="center" style="width:948px; height:600px;"> <img src="LOCMAP.jpg" style="width:4096px; height:3072px" /></div></td>
      </tr>
      <tr>
        <td colspan="2" align="left" valign="bottom"> </td>
      </tr>
      <tr>
        <td colspan="2" align="left" valign="bottom"> </td>
      </tr>
      <tr>
        <td colspan="2" align="left" valign="bottom"> </td>
      </tr>
    </table>
    </body>

Maybe you are looking for

  • Problem with Return table

    Hi all, Greetings! I am facing a probelm with return table, i.e it is adding body record and workarea record also to the data target. so, it is adding the actual record to data target including the workarea record to with the key figure and year valu

  • It shows me that I need to install missing plugins when I click on it it shows that I don't have any missing plugins i reinstalled it three times please help me

    I had a problem opening tumblr so i reinstalled firefox and now whenever open a website it show a bar says additional plugins are required to display all the media on this page then i click on the button next to it that says install missing plugins a

  • Looking for Mac that can handle CPU intensive apps (Music & Video)

    Hi everyone, I am looking to get a new mac in the near future but wanted to know which Desktop mac is best for music and video? I was thinking of the new iMac but not sure if they are powerful enough? I need something that can handle CPU intensive st

  • Regarding HANA DB Driver

    Hi Working on HANA1.0 SPS2 Trying to create a new data store for hana in SAP BO data servcice. and fetch data from DS to HANA system. i cant find HANA DB driver to input as below. In local object library -> New Create new data store Data store name:

  • Accessing Forte method information

    Good afternoon Forte gurus, Earlier this morning there was some dialog regarding how to examine Forte classes given a project from a workspace. I would like to pose my own question for this topic, "how does one know if a method from a class overrides