You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by membersound <me...@web.de> on 2012/11/01 12:23:25 UTC

Grid - align all numbers to the right?

Hi,

is it possible to automatically align all numbers (int, double, BigDecimal)
to the right within a row?
Standard alignment is to the left which is fine for all strings, but I'd
like to have numbers aligned different.

Thanks



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-align-all-numbers-to-the-right-tp5717500.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid - align all numbers to the right?

Posted by membersound <me...@web.de>.
Ok that's not perfect but definitely sufficient for now. THanks!



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-align-all-numbers-to-the-right-tp5717500p5717565.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid - align all numbers to the right?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 01 Nov 2012 12:03:59 -0200, membersound <me...@web.de> wrote:

> I think css cannot differ between strings and integers?
> How could this be possible? I could only use css to align the whole table
> columns to the right.

Grid doesn't support that. And, as I've said before but you seem to have  
overlooked it, Tapestry generates the <td> elements with a CSS class  
matching the BeanModel property name being rendered (that may or not be a  
real property). So, if you have a price property, it will be rendered as  
<td class="price"> and you can attach CSS to that.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid - align all numbers to the right?

Posted by membersound <me...@web.de>.
I think css cannot differ between strings and integers?
How could this be possible? I could only use css to align the whole table
columns to the right.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-align-all-numbers-to-the-right-tp5717500p5717524.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid - align all numbers to the right?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 01 Nov 2012 09:57:13 -0200, membersound <me...@web.de> wrote:

> Ja but then I have to add every <p:nameCell> myself in the tml files and
> align them (eg with a custom css text-aligment tag).

No, you don't. Please read my message again.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid - align all numbers to the right?

Posted by membersound <me...@web.de>.
Ja but then I have to add every <p:nameCell> myself in the tml files and
align them (eg with a custom css text-aligment tag). That's what I hoped to
avoid as I create my BeanModel completely in the backing java page class...



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-align-all-numbers-to-the-right-tp5717500p5717508.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid - align all numbers to the right?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 01 Nov 2012 09:23:25 -0200, membersound <me...@web.de> wrote:

> Hi,

Hi!

> is it possible to automatically align all numbers (int, double,  
> BigDecimal) to the right within a row?

Not completely automated. Notice that Grid adds the property name as a CSS  
class in the <td> elements. Now use CSS to format them in any way you want  
(including text-alignment: right).

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org