2 Replies Latest reply on Jul 8, 2008 12:31 PM by tiamak

    Format single cells in datatable

    tiamak

      hi,


      is there any way to directly format a <td> generated by rich:dataTable dependent on content?


      i have this page: http://colo5-c703.uibk.ac.at:8080/termcomp/competition/competitionResults.seam?category=12691&competitionId=27335
      the table should look similar to this: http://colo5-c703.uibk.ac.at/competition/srs_relative.php


      i can use css to override the rich-table-cell style and remove all padding, but that makes the table very ugly. :)
      any ideas?


      regards,
      sb

        • 1. Re: Format single cells in datatable
          mail.micke
          Hi

          You can use the styleClass attribute of rich:column.

          Ex:

          <rich:column styleClass="#{item.boolValue ? 'normal':'error'}"/>
          Or
          <rich:column styleClass="#{item.cssClass}"/>
          Or
          <rich:column styleClass="#{myfn:getCssFor(item)}"/>
          Or
          <rich:column styleClass="#{cssAssigner.getCssClass(item)}"/>

          Lots of options.

          Good luck,
          Micke
          • 2. Re: Format single cells in datatable
            tiamak

            Mikael Andersson wrote on Jul 08, 2008 12:25:


            <rich:column styleClass="#{item.cssClass}"/>


            *smacks forehead*


            thx, micke. that was the pointer i needed. simple really.


            regards,
            sb