How to align cell data

I want to align numeric data to the right. Below is the syntax I used:



for i=1 to index



If IsNaN(a(i)) then

Response.Write “<cell style=”“text-align:right;”">"

Else

Response.Write “”

End If

next



Is my syntax correct? Can I use style attribute in cell tag. The problem here is that I can display all but the last row right not aligned i.e., sample output is



20

30

40

50

Only 50 is aligned left I am confused with this behaviour. Please suggest



The cell@style must work for any row , without any relation to its position, so the problem may be in your ASP code. I’m not pretty sure, but it may be that
    If IsNaN(a(i)) then

not works as expected.

By the way, you can set align of whole column to the right by using next command
    grid.setColAlign(…

But in ‘View Source’ I can see that even last row is aligned right. Only in the grid it doesnot display. For testing I have included one more row then  all the rows except the last row is aligned right. I think this is the problem with grid. Last row has different properties compared to the other rows. Because when I click on last row and then click on other rows then last row turns white. But when I click on the other rows and click on any other row then those cells dont turn white. Do I need to change any property of grid. please suggest.

Please provide the XML code which generated by your ASP script, because it hard to suggest anything, without ability to recreate problem.
By the way, similar problem may occur if you have non-unique row IDs


Here is my source



 







Here 4 is aligned right but 33 is not aligned right.

Please check attached sample, it uses the same code and works correctly.

1208184280.zip (90.1 KB)