Use <t:column>, which allows you to specify a style for that cell.
Then, your choice is to conditionally render different <t:column>
actions with different styles, or, a cleaner way would be to have the
style value come from a bean value using the Expression Language
(#{...}).- Brendan -----Original Message----- From: Christian [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 21, 2005 11:12 AM To: [email protected] Subject: <dataTable> Howto conditional formating of single cells like in Excel? Hello everyone, I just tried to do conditional table highlighting in <h:dataTable> or <f:dataTable> for a single cell content, without getting a general approach of how to do it. You might help me. Idea: I want to implement an eyecatcher. Just imagine MS Excel-table cells. In Excel you can define formating rules for cells. Example: If the amout of money is negative, it is to be displayed in red, else it is to be displayed in black. In my app I want to do this with a date field, ie. if the date displayed is lower than the date of today (Usecase: "Something is overdue"), it is to be displayed in red instead of black as usual. Situation: My <dataTable> is bound to a managed bean containing a list of dataBeans, works fine. # Things I tried to do: I tried to do component binding to an HtmlOutputText-Component like | <x:dataTable var="list" | [...] | <h:column> | <h:outputText binding="#{list.dateOutputCompontent}" value="#{list.dateOfReturn}"/> | </h:column> | [...] I also tried to do something like: | FacesContext context = FacesContext.getCurrentInstance(); | HtmlOutputText dateOutput = null; | dateOutput = | (HtmlOutputText)context.getViewRoot().findComponent("dueD"); | dateOutput.setStyle("color:red"); in combination with | <h:column> | <h:outputText id="dueD" value="#{list.dateOfReturn}"/> | </h:column> I put the java-code inside the getter of the date value, which did not work. The table-display-result broke at the rendering of the first date-format. Question: Does anyone have an idea of what to do an where to do. Thanks in advance. Regards Christian

