trichview.com

trichview.support




Re: Creating tables with no rows or cells


Return to index


Author

Message

Martin Holmes

Posted: 03/03/2005 16:26:02


Hi there,


That's the solution I'd actually implemented, but I realized that it's

very common to have the first row using colspan > 1 to provide a large

heading, so the first row gives a false account of the number of cells

per row. However, what I think I'll do is count the cells in each row,

then use the largest number.


What I'm doing is very similar to what you had to do; I'm reading XHTML

(which is XML) using the XDOM libraries, and reconstructing a document

from it. It's hard, but it's going to be cool when I get it working. I'm

going to be able to use XHTML as my document storage format, with CSS

handling all the styles.


Cheers,

Martin


Jaap-Willem van den Berg wrote:

> I had the same kind of problem when i generated RVXML files to be

> imported into rv. It is difficult (though posible) when generating xml

> with xsl-templates to know by forehand how many rows and cells you will

> end up with. So i could not specify the amount of rows and rols for a

> table element.

>

> What i did is that i changed the rvxml import tool so that it counted

> the amount of cells in the first row, a table always has at least one

> row. With these values you can create a table. Subsequently you can add

> a row for each row element that is encountered.

>

> This worked for rvxml because each row has the same amount of cells

> (when colspan or rowspan is used, empty cell must be added). This is not

> the case for xhtml.But you can count the values of the colspan

> attributes (if the are present) and the amound of td's without

> colspan-attributes. This gives you the amount of cells each row in the

> table must have.

>

> I agree that it would be nice as it would be possible to create a table

> with no rows or cols, but maybe the solution above can help you in the

> mean time.

>

> Greeting,

> Jaap-Willem van den Berg

>

> Martin Holmes wrote:

>

>> Hi there,

>>

>> I'm working on building tables from an XHTML structure. What I really

>> need to do is to create a table with no rows or cells, then add each

>> row and cell as I go along; this is because cells may be merged

>> (colspan or rowspan > 0), so it's not really possible to know how many

>> cells there will be in each row. What I'd like to do is this:

>>

>> -Create a table with no rows or cells

>>

>> -For each row in my source XHTML:

>>

>>     -Add a row with no cells

>>

>>     -For each cell in the XHTML row

>>

>>         -Add a cell to my row, with the appropriate colspan/rowspan

>> settings read from the XHTML

>>

>> The problem is that the help for TRVTableItemInfo.CreateExCreateEx

>> says "<Row Count> and <Column Count> must be > 0", and

>> TRVTableItemInfo.Create "creates new table with one row and one column".

>>

>> Is there a way to create an empty table? Is there any risk in creating

>> a table with one row, then deleting that row?

>>

>> Cheers,

>> Martin





Powered by ABC Amber Outlook Express Converter