Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to split a row whose rowspan > 1 evenly #692

Closed
ObsisMc opened this issue Apr 4, 2022 · 2 comments · Fixed by #693
Closed

How to split a row whose rowspan > 1 evenly #692

ObsisMc opened this issue Apr 4, 2022 · 2 comments · Fixed by #693
Milestone

Comments

@ObsisMc
Copy link

ObsisMc commented Apr 4, 2022

I use following code to get the result like the first image.

PdfPTable table = new PdfPTable(2);
PdfPCell cell = new PdfPCell();
cell.setRowspan(2);
cell.addElement(new Chunk("rowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspanrowspan"));
table.addCell(cell);

table.addCell("row1"); 
table.addCell("row2");
document.add(table);

图片

However, I want heights of rows in the second column to be the same like following image.
图片

How should I change my code to get the expected result.

@ObsisMc
Copy link
Author

ObsisMc commented Apr 4, 2022

After my investigations, I find that maybe the first case is a default result. Do you think that letting it be split evenly is reasonable?

@asturio asturio linked a pull request May 11, 2022 that will close this issue
@asturio
Copy link
Member

asturio commented May 14, 2022

It seems a nice feature.

@asturio asturio added this to the 1.3.29 milestone May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants