trichview.com

trichview.support




Re: Creating tables with no rows or cells


Return to index


Author

Message

Jaap-Willem van den Berg

Posted: 03/03/2005 12:40:03


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