Welcome! Log In Create A New Profile

Advanced

WebDev-12 - Right-Align a column in a table

Posted by Shahine 
Shahine
WebDev-12 - Right-Align a column in a table
May 28, 2009 07:27PM
Hi All,

How do I right-align a currency column in a table?
I have set the 'Display Mask' = Currency defined by the project (+currency)

At run time the table displays the correct format but it is left-aligned in the column!
The result is something like:

Costs
---------------
£1009.87
£12.10

Which as you can see, looks horrid.




Thanks

Shahine
Paulo Oliveira
Re: WebDev-12 - Right-Align a column in a table
May 28, 2009 07:46PM
Check the details pane of the column, you can change the horizontal & vertical alignment
Hi Paulo,

In WinDev-12 you can, but in WebDev-12 there are no horizontal & vertical alignments!?

In WebDev the Details tab page only has:
Initial Status: Visible, Ajax, Editable/Grayed/Read-only
Options: Reset if zero, Link column
Cursor: Automatic
Column width in pixels:

And the table style-sheet only controls: Table Title, Column Title, Odd Row, Even Row, Selected Row.

Regards

Shahine





Ok..

As a work-around, I put the following code on the 'Row Display" of the table:

TABLE_NAME.COLUMN_NAME..HorizontalAlignment = haRight


And that seems to work.

Not exactly RAD though! Having to write code to right-align a column!
I cannot believe there isn't some sort of a setting somewhere that I am missing?

If anyone out there knows a better way please let me know.

Thanks

Fabrice Harari
Re: WebDev-12 - Right-Align a column in a table
May 28, 2009 11:53PM
Hi...

you just have to use a 'style' for this column where you set the horizontal alignment to right, that's all

Best regards

Christian Potvin.pcs.crosspost
Re: WebDev-12 - Right-Align a column in a table
May 29, 2009 07:43AM
Hi Shahine,
To custom adjust table columns (or any other objects) in Webdev, select the column (or the object) and display the 7 panes window. In the 'Style' pane (last one), you can give the column the style you want by either using a Webdev pre-defined style or creating your own. I always create my own styles following my needs. You can for example create a style named 'Verdana 9 Bold Blue RightAligned', playing with Webdev pre-defined parameters from the 'custom style' window (red icon right of the 'style' combo). You give them your own name. These are equivalent of CSS styles and are very flexible. Look at the help.

Once you have created a style, you can re-use it as much as you want on other objects (other table columns, text fields, labels, etc).

If you do not use your own styles, Webdev uses its own 'generic' pre-defined styles or worse, make it 'local' to the object (each object has his own style, even if the same exact style is duplicated on 50 objects, making the loading of the page far more heavy).

So normally you create 10 to 20 custom styles and use each of them on any number of objects you want. This results in a 'small' CSS style sheet used in your entire website, making the loading of pages far more quicker. A bit longer to program but much more efficient.

Christian

Shahine a écrit dans le message de news <1152009052820400388.28360@news.pcsoft.fr> :
> Ok..
> As a work-around, I put the following code on the 'Row Display" of the table:
> TABLE_NAME.COLUMN_NAME..HorizontalAlignment = haRight
>
> And that seems to work.
> Not exactly RAD though! Having to write code to right-align a column!
> I cannot believe there isn't some sort of a setting somewhere that I am missing?
> If anyone out there knows a better way please let me know.
> Thanks
>
>

Message forwarded from pcsoft.us.windev
Thank you Fabrice and Christian

I was under the impression that the Style applied to the entire table and didn't realise individual columns can have their own style.

I knew there had to be a way. Thank you for that.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: