vandeseer / easytable

Small table drawing library built upon Apache PDFBox
MIT License
239 stars 91 forks source link

New Feature Request - Internal table cell #116

Open grasshopper7 opened 3 years ago

grasshopper7 commented 3 years ago

Functionality to add an internal table to a cell. Similar to the code here - https://gist.github.com/vandeseer/bb86e12d01ca18b9306901ae2bf73cf9

vandeseer commented 3 years ago

I am not fully convinced, to be honest. What benefit does this provide us with in comparison to regular cells that can be spanned over rows and columns? Furthermore there is already a working example (as in your link) that one could use as a basis in case he needs something like this.

grasshopper7 commented 3 years ago

In my case, majority cells have like 4-5 lines of text and then few cells which have a grid of numbers or single words. I can do this with the rowspan and colspan but it really gets confusing as the spanned cell data is spread across various rows. I found it convenient to have an internal table cell which isolates it to one location. It could be an edge case but for me was helpful.

Aidan-OS commented 3 years ago

In my situation, I am trying to recreate a table from an older report generation tool, as shown in the image below: image From what I can tell, there is no way for me to make a table that looks nearly exactly like this with just column and row spanning, which is what the company wants.

vandeseer commented 3 years ago

Well, I understand the issue and there even already is some code for it (see link from above). But I am not quite sure whether this should be included in easytable itself. Also I think it's a bit of a hack.

The case you're making @Aidan-OS, I think, could be done by just adding several tables to the page. I am refraining from adding that feature, because I think then easytable would more and more try to become some kind of layout software. And that stuff is more involved and I never intended to build a sophisticated layout engine, but a helper for simple tables.

Maybe though I can add it and flag it as "experimental". Not quite sure yet.

vandeseer commented 3 years ago

Here is a rendered example by the way: https://stackoverflow.com/questions/59959873/pdf-easytable-may-i-insert-table-within-cell