Table format using textrect()

73 views
Skip to first unread message

chahat bhatia

unread,
Apr 14, 2016, 2:37:15 AM4/14/16
to libHaru
Hey i wanted to know if there's some way to print a proper table with text wrapping and dynamically increasing the rectangle size when ever the text is more than expected . please help what should i do in that case.
Something like the image that i have attached , that there's blank space when ever one of the column has more text than the others. i want to fetch data from the database so i dont know what the size of the text is gonna be , but i want the size of the rectangle to increase dynamicallyy.. please help .
Thanks
800px-Latex_example_wrapped_table.svg.png

Pierre Clouthier

unread,
Nov 13, 2017, 7:40:23 AM11/13/17
to libHaru

Kind of late in the game, but I see no one has answered.

You are going to have to do it the hard way:
  1. Build your text string one line at a time, until it fills the column width.
  2. Start the next line if you overflow. Accumulate the heights of the lines.
  3. Draw a rectangle when you have typeset all the lines.
  4. If a box contains text that does not fill the box, position the text at the top of the box.

With great power comes great responsibility  :o)


Reply all
Reply to author
Forward
0 new messages