Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 8 Jahren, 3 Monaten
Letzter Beitrag:
vor 8 Jahren, 3 Monaten
Beteiligte Autoren:
Shahine, Christian Potvin.pcs.crosspost, Paulo Oliveira, Fabrice Harari

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

Startbeitrag von Shahine am 28.05.2009 17:27

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

Antworten:

Check the details pane of the column, you can change the horizontal & vertical alignment

von Paulo Oliveira - am 28.05.2009 17:46
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







von Shahine - am 28.05.2009 18:19
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



von Shahine - am 28.05.2009 18:30
Hi...

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

Best regards



von Fabrice Harari - am 28.05.2009 21:53

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

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 :
> 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

von Christian Potvin.pcs.crosspost - am 29.05.2009 05:43

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

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.


von Shahine - am 29.05.2009 08:50
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.