StartTable() && LineBreak


#1

Hi,

It is possible to insert a table into the first row of a page of a document using StartTable()? It seems, that StartTable() always insert an additional line break before the new table. How can I avoid that behavior?

Within my project the start point of the first table is given by a bookmark. Using MoveToBookmark(“xxx”) followed by StartTable() generates the output, described above. Any suggestions?

Thanks

Erik


#2

It works for me. Please post your document, it could help to clarify.

I have this document:

[bmk]\r
\r

This code:

Document doc = TestUtil.Open(@"Other\TestTableIntoFirstParagraph.doc");

DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveToBookmark("bmk");

builder.StartTable();

builder.InsertCell();

builder.Write("XXX");

builder.EndRow();

builder.EndTable();

TestUtil.Save(doc, @"Other\TestTableIntoFirstParagraph Out.doc");

and I get this document:

|XXX|
\r
\r

Where XXX is in a table.


#3

I found the mistake. There was a page break before the mentioned bookmark in my document template. If I exectue the same operation without a page break it works.

Erik