Hue,
I think i actually wrote the original table to_a code. I wrote it for a
specific table, and Paul checked it in. It was never intended to work in
the general case.
I don't quite understand why Paul says it couldn't be fixed the way you
want it to work. I think his concern is that it still wouldn't work in the
general case. Figuring out how this should work in general is a hard design
problem.
I do think any of us could write a function that worked the way you wanted.
But this is really something that you should be able to write yourself. One
way would be to edit the standard watir.rb. But probably a better idea
would be to change the Table#to_a method separately. Here's how. In a
separate file:
class Table
def to_a
# replacement code
end
end
Then look at what we have a figure out how you might want to change it.
Bret
At 09:40 PM 8/10/2005, Paul Rogers wrote:
I took a quick look at this, and I don't know how we would do it. Using
my example table below, The table itself only has 2 cells on the row
after the rowspan.
Even other methods like the one below only show it has having 2 cells, I
guess cos in reality it does only have 2 cells.
irb(main):011:0 puts ie.table(:index,1).row_values(3)
c2
c3
Sorry I couldn't help more
Paul
c1c2c3
2 rowsc2c3
c2c3
Normalc2c3
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hue Mach Dieu
Sent: 10 August 2005 19:47
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Help read data in table with Row Span
Dear All,
My application table display data as like this
---
| Col 1 | Col 2 | Col 3 | ...
---
| V1 | V2 ..
| Row 1 | -
| V3 | V4 ..
---
| Row 3 | V5 | V6...
---
...
When I use method: table(..).to_a
I got this result:
= [[Col 1, Col 2, Col 3,..], [Row 1, V1, V2,..], [V3,
V4,..],Row 3, V5, V5,..] ]
Looking this result, I found this value [V3, V4,..] missing 1
column.
So any solution for this table, that mean I would like the value get
from table always don't missing any column and row in case have row span
or column span
Ex: With the case above, I would like the value I got from table as like
this:
[[Col 1, Col 2, Col 3,..], [Row 1, V1, V2,..], [nil, V3,
V4,..],Row 3, V5, V5,..] ]
Or
[[Col 1, Col 2, Col 3,..], [Row 1, V1, V2,..], [Row 1,
V3, V4,..],Row 3, V5, V5,..] ]
Thank you for help.
Hue
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_
Bret Pettichord
www.pettichord.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general