PhilterPaper / PDF-Table

Official repository for PDF::Table in Perl
https://www.catskilltech.com/FreeSW/product/PDF%2DTable/title/PDF%3A%3ATable/freeSW_full
Other
10 stars 15 forks source link

Span cells across columns #46

Closed abeverley closed 4 years ago

abeverley commented 6 years ago

Is there any way to span cells across multiple columns? E.g. similar to the HTML colspan attribute.

If not, I would be interested in sponsoring the implementation of this feature.

kamenov commented 6 years ago

There isn't an out-of-the-box property for that but can be work-arounded with text_block() or cell_callback_func. I'm more than happy to merge a PR that introduces a property with html-like behaviour.

abeverley commented 6 years ago

Thanks for the (very!) quick reply, and thanks for the information.

Would you be interested in sponsorship to implement such a feature?

kamenov commented 6 years ago

Wow, It's been a while after my first fast response, apologies. I'm not interested in implementing the feature but i believe i can find a person that can do that for you - all credits and sponsorship will go to them if you both like each other :) shall I poke around for a suitable person?

abeverley commented 6 years ago

No problem, thanks for letting me know, and thanks for the offer. I've actually recently approached @domm who is interested, so I'll see how that goes, and I'll let him liaise with you in terms of the implementation. Many thanks!

domm commented 6 years ago

Without having looked at the code yet, I see two options to add the col-span param: a new entry in the cell_props, or by passing a hashref instead of a string in data:

via cell_props it could look like:

$cell_props->[4][2] = {
    col_span => 2
};

via data:

my $some_data = [
    [ 'Header',              'Row',   'Test' ],
    [ '1 Lorem ipsum dolor', 'Donec', 'consequat quis, tincidunt vel, felis.' ],
        [ { text => 'this will span!', col_span => 2  }, 'the third colum' ],
]

I think the second option feels nicer, because everything is in one place. But as the rest of the API is using cell_props I guess adding a new cell_prop is more in line with the rest of the module.

Any opinions on that?

abeverley commented 5 years ago

@kamenov - do you have any thoughts on @domm's comments above please? Many thanks.

kamenov commented 5 years ago

I prefer the cell_props approach as it is in line with the rest of the code and also it's not a good practice to modify your input data. (sorry for the delayed response)

PhilterPaper commented 4 years ago

There is a "colspan" feature in PDF::Table. Does this do what you are looking for? If so, I can close this ticket.

westmj commented 4 years ago

I found a work-around, outside PDF:: Table, so this is not currently on my radar. But seeing you get active on P::T, let me try to get back to it. Watch this space!

Mike West mwjwest@gmail.com

Phone & WhatsApp: +1-302-559-3642 Address: Casa Alquimía 350 m SUR y 80 m ESTE de la Gasolinera Monteverde Monteverde, Puntarenas, Costa Rica 60109 www.facebook.com/mwjwest mwjwest.wordpress.com

On Fri, Apr 10, 2020, 8:48 AM Phil Perry notifications@github.com wrote:

There is a "colspan" feature in PDF::Table. Does this do what you are looking for? If so, I can close this ticket.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PhilterPaper/PDF-Table/issues/46#issuecomment-612061578, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHPAFG2DCZ6V4RJY2CYQTLRL4WUXANCNFSM4FXSD62Q .

abeverley commented 4 years ago

There is a "colspan" feature in PDF::Table. Does this do what you are looking for? If so, I can close this ticket.

Yes, this feature has now been implemented and merged (sponsored by me, written by @domm), so this issue can be closed now. Many thanks.