prakhar211 wrote:Could you please provide sample code for the below questions
Sorry, no. I support docx4j, but you are presumably paid a salary to write code. Similar to StackOverflow, after you've written some code, I can provide some help if you are still having problems.
For both your questions, you need to test the column 4 value, and then set appropriate row or cell properties. Look at the OpenXML of a suitably formatted table to understand what you need to set. You can generate corresponding code.