-
How is it possible to create a table cell with text that has different color? Only one style can be applied to a single cell, so it seems to not be possible. Any hints or opinions about this? I looked at the implementation of cells in the code and am wondering where it could be implemented.
Could this be used here in FPDF2's table method _render_table_cell? It looks like replacing multi_cell with an adapted method should do the trick.
Actually, diving one level deeper, I think
Any thoughts? It would be an elegant way to make working with tables more flexible, in my opinion. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @JSchoeck
Sure, you can even find examples of that in our documentation:
A |
Beta Was this translation helpful? Give feedback.
Oh alright, I didn't quite understand what you were trying to achieve, sorry 😅
Support for ANSI escape characters, is an interesting idea,
and yes it would allow to color fragments of text in a single cell in different shades.
And yes, it should be implemented at the
FPDF._render_styled_text_line()
level,but also beforehand in
fpdf.line_break
when parsing lines intoTextLine
&Fragment
objects.A
Fragment
already has a.graphics_state
attribute that contains itstext_color
.Is this something that you would be interested on working on @JSchoeck? 🙂