vandeseer / easytable

Small table drawing library built upon Apache PDFBox
MIT License
246 stars 94 forks source link

Different colors for each side of the cell #97

Open kruthikarshankar opened 4 years ago

kruthikarshankar commented 4 years ago

I have a requirement where I need the table's overall border to be one color (BLACK) and the interior rows of the table separated with a GRAY color and no color for the column separators. Is there a way to maybe set the table border color to be BLACK after the rows are all added, and keep individual row border color to be GRAY?

vandeseer commented 4 years ago

Hi @kruthikarshankar,

as of now there is now way (yet!) to set the border colors of each side individually. But this can be added to easytable soon. There was simply no one before you asking for it. 😉

What you could do in the meantime is to work around it, e.g. something like this: https://gist.github.com/vandeseer/85e7124a1f153bc402b76123e2feb263

You would need to extend some of the table drawing classes which is a bit more involved ... If I find some time I can give it another shot, but just to get an idea.

Hope this helps, Stefan

kruthikarshankar commented 4 years ago

I will look at the custom drawer here and try to implement it. I ended up adding a lot of extra functionality to accommodate 508 compatibility to the table structure, but we are out of time, and may not have the bandwidth to implement this although I am curious to try.

vandeseer commented 4 years ago

Basically the implementation should be more or less the same as for different border widths (they can be set separately already). I would be more than happy to review a pull request, otherwise I will try to implement this in the next weeks ... 😉

Regarding your changes for 508 compatibility: Is this something the whole library could benefit from or is it something specific for your current context?

vandeseer commented 4 years ago

I implemented the feature of individual border colors. You can try it out with this branch: feature/individual-border-colors

In the next days I'll try to add some tests and then publish it on maven.

kruthikarshankar commented 4 years ago

Haa, I was halfway through the implementation when I read your message. Thank you. I was able to incorporate the remainder of the updates as well. About the 508, currently it is not very portable. I am cleaning it up so it is not tightly coupled with my application. Once that is done, I will need to add tagging for areas that I did not need to tag for my needs. Then I can add it to a branch here? Let me know. I am looking at a month's time.

Aidan-OS commented 3 years ago

Hi, when will this branch be merged in? I would love to use this library for what I am currently working on, but due to the nature of the project I am required to use it through maven. I would need this feature to be able to use the library.

vandeseer commented 3 years ago

Hey @Aidan-OS,

thanks for reminding me! 😄

I merged this to develop just now. It only needs a proper test and then it can be released. Shouldn't be too hard to add the test – in the meantime just checkout the develop branch and install it locally.

Best, Stefan

Aidan-OS commented 3 years ago

Great to hear!