I want to create a dynamic table in word doc using apache poi. So for examples - In my case there are 9 rows. In 1st row there is only 1 column. In 2nd, 4th and 5th rows there are 2 columns. In 3rd and 6th rows there are 3 columns. In 7th, 8th and 9th rows there are 7 columns. Also, how can i set the text in bold for specific cell.
Take a look at the attached snapshot for more clarification.
This may not be possible. While the org.apache.poi.hwpf.usermodel.TableCell class has methods to determine whether an existing cell is merged with another cell, I don't see methods that would create merged cells, or let you merge cells after they have been created.
Ping & DNS - updated with new look and Ping home screen widget
If you plan to use a single table then it's practically impossible. Word isn't Excel.
However, you can split the relevant rows into sections and each section is its own table. This way you can use the org.apache.poi.hwpf.usermodel.TableRow class to align each row. If you do this, not sure if there will be space between each so-called table.