1 Reply Latest reply on Nov 9, 2010 3:43 AM by Tanu Jain

    How to create pseudo table in TextArea ?

    Adam.Szecowka

           Hello,
      I want to create pseudo table in spark TextArea: put some information in columns. I want to separate each column by adding tab between them (each "cell" from one column should has got the same width), and I have problem when I measure text width. I use label, and method mesure text, for example:
                     var label:Label = new Label();
                      label.regenerateStyleCache(false);
                                                 
                      var textMetrics:TextLineMetrics = label.measureText("some text with \t\t "); 
                      var spaceWidth:int = textMetrics.width;

       

      But this method doesn't work, especially when measured text contain TAB, returned value is incorrect.
      Could anybody help me ?