vandeseer / easytable

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

Configurable Columns #126

Closed MergimHo closed 3 years ago

MergimHo commented 3 years ago

Hi!, very nice code. Thank you for that.

One suggestion: It may be beneficial to add configurable Columns, so that I can specificy whether a column should have a horizontal alignment right (e.G. if its a integer, like in excel) or in the middle or on the left.

Currently this is not possible as the settings are just on cell or row level.

vandeseer commented 3 years ago

Hey @MergimHo,

thanks for your request. Yes, you are right. A column does not support this as of now. I didn't really consider adding it until now but I can see at least one difficulty coming up. When having row spanning and column spanning the question is which setting (the row setting or the column setting) should get precedence? Or should it fall back to the setting from the table or the cell in this case? What if they are not set?

Still, I think you are right: It would add a bit of convenience if one could set different things already on the column level. But even then the question arises: If we set center alignment on column level and right alignment on row level what should happen?

Feel free to share your ideas on that issue! :)

Cheers, Stefan

MergimHo commented 3 years ago

Hi Stefan, actually this is quite easy. Most of the tables work that way that their type is determined by the column. Row-level types and the data along the colums is very rare.

So it would be good to allow Column-Level configuration. And if the user needs, overwrite that with row level configs.

vandeseer commented 3 years ago

This is now part of the develop branch and will be released with the next release. The precedence for the settings is: cell level has highest precedence, then column, then row and finally table level.

vandeseer commented 3 years ago

Released with 0.8.4