Hi,
Hi Visual,
Document doc = new Document();<o:p></o:p>
Page page = doc.getPages().add();
// Initializes a new instance of the Table
com.aspose.pdf.Table table = new com.aspose.pdf.Table();
table.setColumnWidths("150 150");
// add row to table
com.aspose.pdf.Row row1 = table.getRows().add();
// add table cells
row1.getCells().add("Column 1");
row1.getCells().add("Column 2");
row1.setBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.Bottom, .5f, com.aspose.pdf.Color.getLightGray()));
// create a loop to add 10 rows
for (int row_count = 1; row_count < 5; row_count++)
{
// add row to table
com.aspose.pdf.Row row = table.getRows().add();
// add table cells
com.aspose.pdf.Cell cell1 = row.getCells().add();
cell1.getParagraphs().add(new TextFragment("test"));
com.aspose.pdf.Cell cell2 = row.getCells().add();
row.setBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.Bottom, .5f, com.aspose.pdf.Color.getLightGray()));
}
// Add table object to first page of input document
page.getParagraphs().add(table);
doc.save(myDir+"table_out.pdf");
Please feel free to contact us for any further assistance.
Best Regards,