You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Caroline Jen <ji...@yahoo.com> on 2005/10/26 17:28:08 UTC

text-align in

I created a data table with four columns.  By default,
the text of each column of the table is left aligned.

I am trying to make the text of certain columns of the
table to be 'centered'.  And I tried to use the
columnClasses in the dataTable tag to do it but failed
(i.e. all text is still left aligned.).  Maybe someone
could help me in spotting the mistake that I made.

My JSP:
[code]
<html>
<head>
  .....
    <link href="../includes/MilPDS_Style.css"
rel="stylesheet" type="text/css">
</head>
<body>
    <f:view>
        <h:form id="errorLog">		
  ......
            <h:dataTable
value="#{logManagementBean.errors}" var="eInfo"  
rowClasses="row1,altRow" columnClasses="nameColumn,
numberColumn, timeColumn, messageColumn">

  ......
            </h:dataTable>
        </h:form>
    </f:view>
</body>
</html>
[/code]

I swear that I can access the stylesheet
MilPDS_Style.css because the rest of the
specifications in the stylesheet get picked up
successfully.  And my MilPDS_Style.css has:
[code]
.nameColumn {
    text-align: left; 
}
.numberColumn {
    text-align: center;
}
.timeColumn {
	text-align: center;
}
.messageColumn {
	text-align: left;
}
[/code]


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: text-align in

Posted by Mathias Brökelmann <mb...@googlemail.com>.
rowClasses go into <tr class="...">
columnClasses go into <td class="...">

2005/10/27, Marius Kreis <ma...@nulldevice.org>:
> I wonder if it is allowed to use the attributes rowClasses and
> columnClasses together.... one cell can only have one class, can't it?
>
> Caroline Jen wrote:
> > I created a data table with four columns.  By default,
> > the text of each column of the table is left aligned.
> >
> > I am trying to make the text of certain columns of the
> > table to be 'centered'.  And I tried to use the
> > columnClasses in the dataTable tag to do it but failed
> > (i.e. all text is still left aligned.).  Maybe someone
> > could help me in spotting the mistake that I made.
> >
> > My JSP:
> > [code]
> > <html>
> > <head>
> >   .....
> >     <link href="../includes/MilPDS_Style.css"
> > rel="stylesheet" type="text/css">
> > </head>
> > <body>
> >     <f:view>
> >         <h:form id="errorLog">
> >   ......
> >             <h:dataTable
> > value="#{logManagementBean.errors}" var="eInfo"
> > rowClasses="row1,altRow" columnClasses="nameColumn,
> > numberColumn, timeColumn, messageColumn">
> >
> >   ......
> >             </h:dataTable>
> >         </h:form>
> >     </f:view>
> > </body>
> > </html>
> > [/code]
> >
> > I swear that I can access the stylesheet
> > MilPDS_Style.css because the rest of the
> > specifications in the stylesheet get picked up
> > successfully.  And my MilPDS_Style.css has:
> > [code]
> > .nameColumn {
> >     text-align: left;
> > }
> > .numberColumn {
> >     text-align: center;
> > }
> > .timeColumn {
> >       text-align: center;
> > }
> > .messageColumn {
> >       text-align: left;
> > }
> > [/code]
> >
> >
> >
> >
> > __________________________________
> > Yahoo! Mail - PC Magazine Editors' Choice 2005
> > http://mail.yahoo.com
> >
>
>


--
Mathias

RE : text-align in

Posted by Arnaud Jeansen <ar...@edifixio.fr>.
It is allowed, we use it regularly on our project.
AFAIK, on the <table> created by the dataTable, rowClasses definitions will
apply as <tr class=""> elements, and columnClasses definitions will apply as
<td class=""> elements.

Does the generated HTML in the example generate this ?


-----Message d'origine-----
De : Marius Kreis [mailto:mail@nulldevice.org] 
Envoyé : jeudi 27 octobre 2005 11:21
À : MyFaces Discussion
Objet : Re: text-align in <h:dataTable>


I wonder if it is allowed to use the attributes rowClasses and 
columnClasses together.... one cell can only have one class, can't it?

Caroline Jen wrote:
> I created a data table with four columns.  By default,
> the text of each column of the table is left aligned.
> 
> I am trying to make the text of certain columns of the
> table to be 'centered'.  And I tried to use the
> columnClasses in the dataTable tag to do it but failed
> (i.e. all text is still left aligned.).  Maybe someone
> could help me in spotting the mistake that I made.
> 
> My JSP:
> [code]
> <html>
> <head>
>   .....
>     <link href="../includes/MilPDS_Style.css"
> rel="stylesheet" type="text/css">
> </head>
> <body>
>     <f:view>
>         <h:form id="errorLog">		
>   ......
>             <h:dataTable
> value="#{logManagementBean.errors}" var="eInfo"
> rowClasses="row1,altRow" columnClasses="nameColumn,
> numberColumn, timeColumn, messageColumn">
> 
>   ......
>             </h:dataTable>
>         </h:form>
>     </f:view>
> </body>
> </html>
> [/code]
> 
> I swear that I can access the stylesheet
> MilPDS_Style.css because the rest of the
> specifications in the stylesheet get picked up
> successfully.  And my MilPDS_Style.css has:
> [code]
> .nameColumn {
>     text-align: left;
> }
> .numberColumn {
>     text-align: center;
> }
> .timeColumn {
> 	text-align: center;
> }
> .messageColumn {
> 	text-align: left;
> }
> [/code]
> 
> 
> 	
> 		
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 



Re: text-align in

Posted by Marius Kreis <ma...@nulldevice.org>.
I wonder if it is allowed to use the attributes rowClasses and 
columnClasses together.... one cell can only have one class, can't it?

Caroline Jen wrote:
> I created a data table with four columns.  By default,
> the text of each column of the table is left aligned.
> 
> I am trying to make the text of certain columns of the
> table to be 'centered'.  And I tried to use the
> columnClasses in the dataTable tag to do it but failed
> (i.e. all text is still left aligned.).  Maybe someone
> could help me in spotting the mistake that I made.
> 
> My JSP:
> [code]
> <html>
> <head>
>   .....
>     <link href="../includes/MilPDS_Style.css"
> rel="stylesheet" type="text/css">
> </head>
> <body>
>     <f:view>
>         <h:form id="errorLog">		
>   ......
>             <h:dataTable
> value="#{logManagementBean.errors}" var="eInfo"  
> rowClasses="row1,altRow" columnClasses="nameColumn,
> numberColumn, timeColumn, messageColumn">
> 
>   ......
>             </h:dataTable>
>         </h:form>
>     </f:view>
> </body>
> </html>
> [/code]
> 
> I swear that I can access the stylesheet
> MilPDS_Style.css because the rest of the
> specifications in the stylesheet get picked up
> successfully.  And my MilPDS_Style.css has:
> [code]
> .nameColumn {
>     text-align: left; 
> }
> .numberColumn {
>     text-align: center;
> }
> .timeColumn {
> 	text-align: center;
> }
> .messageColumn {
> 	text-align: left;
> }
> [/code]
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 


Re: text-align in

Posted by Bruno Aranda <br...@gmail.com>.
Although that should work, there is a tomahawk extended column
component (t:column) which has some useful attributes. One of the
attributes is the styleClass, so you could use:

<t:datatable var="row" ...>
    <t:column styleClass="messageColumn">
    ...
    </t:column>
...
</t:datatable>

This makes everything more clear...

Bruno

2005/10/26, Caroline Jen <ji...@yahoo.com>:
> I created a data table with four columns.  By default,
> the text of each column of the table is left aligned.
>
> I am trying to make the text of certain columns of the
> table to be 'centered'.  And I tried to use the
> columnClasses in the dataTable tag to do it but failed
> (i.e. all text is still left aligned.).  Maybe someone
> could help me in spotting the mistake that I made.
>
> My JSP:
> [code]
> <html>
> <head>
>   .....
>     <link href="../includes/MilPDS_Style.css"
> rel="stylesheet" type="text/css">
> </head>
> <body>
>     <f:view>
>         <h:form id="errorLog">
>   ......
>             <h:dataTable
> value="#{logManagementBean.errors}" var="eInfo"
> rowClasses="row1,altRow" columnClasses="nameColumn,
> numberColumn, timeColumn, messageColumn">
>
>   ......
>             </h:dataTable>
>         </h:form>
>     </f:view>
> </body>
> </html>
> [/code]
>
> I swear that I can access the stylesheet
> MilPDS_Style.css because the rest of the
> specifications in the stylesheet get picked up
> successfully.  And my MilPDS_Style.css has:
> [code]
> .nameColumn {
>     text-align: left;
> }
> .numberColumn {
>     text-align: center;
> }
> .timeColumn {
>         text-align: center;
> }
> .messageColumn {
>         text-align: left;
> }
> [/code]
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>