boxable
boxable copied to clipboard
Cell.copyCellStyle(Cell) does only copy some part of the style
The current implementation copies the border style for all borders from the top border of the source cell but preserves the left border if it was null.
Also it doesn't copy the font size but the font type and color.
I think that's not intuitive. Why not copy all the border styles seperately. Why not copy the font size? The name of the Method suggests that it copies the style of the cell, so it should actually do this.
I wonder why this is. Is this some sort of historical behavior?
Hi,
the left border is not set if it was null, because only the first cell in a row should have a left border. The fontSize not being copied is a bug, and I'll fix it as soon as I can.
Thanks,
Dries
Thank you for your reply. Your argument for keeping the left border null is logical.
For my use case where I defined two cells with a seperating border in the middle it would be great to have a copy Method that actually copies all the borders of the cell.
This way I could simply copy down the style of the two cells of the first row to the cells of all following cells.
Maybe an additional method copyCellStyle(Cell, boolean) would be possible, where the current copyCellStyle(Cell) would call copyCellStyle(Cell, false) and the new copyCellStyle(Cell, boolean) copies the border styles one by one if the boolean is true?
I also have another question unrelated to this one: Is it possible to get the height of the table on the last page of a multi page table. I need that height to insert a table with dynamic data possibly spanning multiple pages, but insert other things after the table. There seems to be no method for this use case. I guess the Table class would need to keep track of how which rows where drawn on the last page and sum up the height of these rows including the drawn headers?
The draw method should return the bottom position of your table. You should be able to work with that.
float posY = table.draw();
Oh. That's easy. Now I feel a little bit stupid, but in my defense there is no javadoc on this method. ;) I wonder if you need help filling in javadoc. I only started using your library today and I'm constantly looking at the code to understand what the methods do and parameters mean. More javadoc would help tremendously.
Thank you btw for the fast responses
Well, there's multiple efforts going on :
- Documentation in #41 , I assume javadoc could be a part of that.
- An effort to make the library easier to use, in the api-SoC branch, discussion in issue #20
Any help is always appreciated.
I think that the version 1.4 on Maven doesn't contain the fix on cell fontSize.
This library is fantastic.
Thanks, Giorgio.