Hi,
I am have created a table in the document through following code :
foreach (object T in arr10)
{
Partbuilder Q = (Partbuilder)T;
foreach (object S in arr2)
{
Partbuilder B = (Partbuilder)S;
Table table = new Table(nav.Document);
nav.InsertTable(table);
//Table contents goes here
//Section section = document.AddSection();
String[] Footer = { "","","" };
string price = Db.Checkfordecimal(B.ListPrice);
string leftcolumn = "Supply " + B.Quantity + " X " + B.ProductDescription + "" + B.ProductCode + "";
String[][] data ={
new String []{""+leftcolumn +"","","£" + price + ""}
};
table.ResetCells(data.Length + 1, Footer.Length);
for (int r = 0; r < data.Length; r++)
{
TableRow datarow = table.Rows[r + 1];
datarow.Height = 10;
datarow.RowFormat.BackColor = Color.Empty;
for (int c = 0; c < data[r].Length; c++)
{
datarow.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
ITextRange Text2 = datarow.Cells[c].AddParagraph().AppendText("" + data[r][c] + "");
Text2.CharacterFormat.FontName = "verdana";
Text2.CharacterFormat.FontSize = 10;
Text2.CharacterFormat.Italic = true;
Text2.CharacterFormat.Bold = false;
}
}
}
Problem that currntly having:
1. How can I specify table column width?
2.its generats empty row for each row above, how to remove those empty rows.
3.Is there any way that I can align right text in a column.
Please advise by code as soon as possible.
Thank you very much for your time.