Editing Data in DocumentBuilder Builder - Table Example

Hi,

Is possible to edit data a cell of a table created using StartTable(). For example, I have cell where I populate it using the builder.InsertHtml(). I would like to be able to edit this content. I every time data is entered using InsertHtml() an extra new line/paragraph is added to the data.

My code looks like:

string content = "<p>content</p> // this is the format that I get the html in <p> .... </p>";

builder.StartTable();
builder.InsertCell();
builder.InsertHtml(content);
builder.InsertCell();
builder.WriteLn(" ");
builder.EndRow();
builder.EndTable();

The resulting table formed is:
---------------------------------------------------------

content<end line /paragraph mark> <end cell>
<end cell>

---------------------------------------------------------

So is there any way I can go into cell 1 and remove the endline? There is no end line (\n) that I can find in “content”. It seems like Aspose is adding the enter.

Thanks.

Hi Rob,
Thanks for your inquiry.
Most likey the cell already has a blnak paragraph which causes the blank line after inserting content. You can use code like below to delete the empty paragraph.

builder.StartTable();
Cell cell = builder.InsertCell();
builder.InsertHtml(content);
cell.Paragraphs[1].Remove();
builder.InsertCell();
builder.WriteLn(" ");
builder.EndRow();
builder.EndTable();

Thanks,