You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dawson Schaffer <da...@hotmail.com> on 2003/07/04 03:47:35 UTC

Different CSS class styles for each Table Column

I need to set different CSS class styles and widths for each of the columns 
within various tables in our application.  I have searched, and have not 
come across any example nor can I ascertain from the documentation how to 
specify various widths or CSS class styles for each individual column.  To 
make the matter a bit harder the header row has different styles than the 
body.  Although that could be fixed with similar class names tied to element 
(e.g. TD.left, TH.left).

I have tried using the TableView, etc. and have been able to get the header 
row to format in one class style or another:

<span jwcid="view@contrib:TableView"  tableModel="ognl:notesTableModel" 
width="680" border="0" cellspacing="0" cellpadding="4" class="border">
     <span jwcid="cols@contrib:TableColumns" class="left"/>
</span>

I am using dynamic creation at the moment for testing purposes, just to see 
if we can get these working before we switch from Foreach components.  I'm 
doing this piece by piece, so yes I know the rows are not rendering :).  We 
are for the most part planning on using the SimpleModels... (Table, Column, 
etc.) with no paging (model.getPagingState().setPageSize(Integer.MAX_VALUE)) 
unless there is a simpler way to do it.

Any help, suggestions, or examples would greatly be appreciated.

Cheers, Dawson M. Schaffer

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


Re: Different CSS class styles for each Table Column

Posted by Jeevan Bihari <je...@yahoo.com>.
Here is MindBridge's solution to the prolem you had mentioned in your e-mail below:

"If you work with the Table component:  use the 'column' parameter to
determine what the current column is (it returns an ITableColumn) and then
use the 'valuesClass' parameter to define what the <td> alignment is using
CSS.

		 If you work with the lower level components or cannot use CSS for some
reason: in the TableValues component use the 'column' binding to determine
what the currently rendered column is, and pass the additional attributes as
informal parameters (e.g. bind 'align' to a method that returns 'left' or
'right' depending on the column obtained via the 'column' binding)."

This is from the mailing list dated May 23rd. Hope that helps.

Jeevan

--- Dawson Schaffer <da...@hotmail.com> wrote:
> I need to set different CSS class styles and widths for each of the columns 
> within various tables in our application.  I have searched, and have not 
> come across any example nor can I ascertain from the documentation how to 
> specify various widths or CSS class styles for each individual column.  To 
> make the matter a bit harder the header row has different styles than the 
> body.  Although that could be fixed with similar class names tied to element 
> (e.g. TD.left, TH.left).
> 
> I have tried using the TableView, etc. and have been able to get the header 
> row to format in one class style or another:
> 
> <span jwcid="view@contrib:TableView"  tableModel="ognl:notesTableModel" 
> width="680" border="0" cellspacing="0" cellpadding="4" class="border">
>      <span jwcid="cols@contrib:TableColumns" class="left"/>
> </span>
> 
> I am using dynamic creation at the moment for testing purposes, just to see 
> if we can get these working before we switch from Foreach components.  I'm 
> doing this piece by piece, so yes I know the rows are not rendering :).  We 
> are for the most part planning on using the SimpleModels... (Table, Column, 
> etc.) with no paging (model.getPagingState().setPageSize(Integer.MAX_VALUE)) 
> unless there is a simpler way to do it.
> 
> Any help, suggestions, or examples would greatly be appreciated.
> 
> Cheers, Dawson M. Schaffer
> 
> _________________________________________________________________
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com