1 Reply Latest reply on Nov 18, 2009 11:28 AM by v c

    controlling table cell size (rich:column)

    v c Newbie

      hihi all,

      i'm not having success with controlling table cell sizes. (i'm using rich:scrollableDataTable, but i understand the rich:column is a generic column component to be used in any type of table)

      i have tried adjusting the height/width attributes, but these seem to *only* respond to discrete values... it doesn't respond to percentage sizing.

      i have also tried to apply CSS values using the style attribute like the following without *any* success (i.e. the height and width CSS values seem to be ignored):

      <rich:column id="description" style="height: 200px; width: 300px; white-space: normal;" >
       <f:facet name="header"><h:outputText style="font-size: 14px; font-weight:bold;" value="Description" /></f:facet>
       <h:outputText value="#{item.description}" style="height: 200px; width: 300px; white-space: normal;"/>

      some other posts have suggested this workaround too, that is, to use the style attribute to control height and width via CSS. so am i doing something wrong? why are my CSS values being ignored? when i inspect the HTML code in FireFox the generated and related parent elements indeed do not have any of the CSS values i entered.

      also, you will notice that i have instructed the text to wrap using "white-space: normal". the text can be long or short depending on the data so ideally, the cell would react to this by increasing the height (i think this is the expected normal behavior of tables), but instead the cell height does not change (which could be a good thing in some cases) so the wrapped text is clipped. is there a work-around for this? the text length is variable. how can i know how high each cell should be in a data-driven application? and i don't want to force every cell to the same size; each cell should react to the contents.

      how can i tackle these issues? any strategies/help is much appreciated!
      thanks in advance!


        • 1. Re: controlling table cell size (rich:column)
          v c Newbie

          hihi all,


          all the issues seem to apply specifically to the rich:scrollableDataTable component only.

          when i switched to use the rich:dataTable component my CSS directives were respected, and the cell height does increase to accomodate displaying cell contents fully.

          ... i guess i shouldn't have assumed consistent table behavior across all table components >_<