https://support.content.office.net/en-us/media/fbe67397-658c-4b04-b295-b0d6759e1aaa.jpg
Hello Everyone I need to add Line spacing Before(Spacing about 6pt) effect inside the table.You can see the above image that has a paragraph spacing i need that effect. I am using 5.0.0 version. And checked on many sites. nothing useful. if someone help me that will be great. Thank You in advance :)
To set the paragraph spacing
apache poi
provides XWPFParagraph.setSpacingBefore and XWPFParagraph.setSpacingAfter. Measurement unit for theint
is twentieths of a point. So8*20
is8 pt
.In a table one needs get the first paragraph of a
XWPFTableCell
to set spacing before:But if the requirement is vertical aligning in cell, then XWPFTableCell.setVerticalAlignment should be used. But this only can be rendered properly if there is no spacing after the last paragraph which pushs the paragraph upwards.
So