Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: TableMatrix multiline

by PeterPeiGuo (Hermit)
on Jan 15, 2011 at 01:18 UTC ( [id://882432] : note . print w/replies, xml ) Need Help??


in reply to TableMatrix multiline

It looks like that TableMatrix does not support auto-resize.

But it won't be too difficult for you to calculate the number of lines that the text of a cell occupies. To simplify the matter: 1) don't auto-resize the width (use ColWidth function to get the current width of a cell), and only auto-resize the height; 2) Measure height and width in characters, not pixels.

When you calculate the number of lines, don't forget to handle special characters like \n.

Call RowHeight to resize the cell (height only).

Peter (Guo) Pei