HTML Tables in Flex

Most of the flex develpors a face a common problem to render html tags . Flex do not have the abillity to render complex html tags like <table> tags , but  Adobe Air is having a HTML control for rendering the html. I think the full html rendering ability is not included in flash player inorder to keep it light weight .

I faced a similar problem to render html tables in flex. I have a tried  a third party html component inorder to render html . That component is working well , but the hmtl is a appearing as a layer on top of the swf giving scrolling issues always.

Then i tried to create component based on the Grid Component in flex which is similar to the HTML Table .  The component will accept an html string containing table tags and will use regular expressions to parse the string to create Grid rows and columns. 

The component is working correctly for simple tables , now need to include the ability to render style attributes .

I have not posted the code because i am still working on it . If any one is interested to know about this , or know some other technique to render html in flex , please leave a message here

Subeesh 

2 Responses to “HTML Tables in Flex”

  1. I am interested in how to create html table to display in grid, but not sure what you are talking about. You are parsing out the html table tags and then displaying?
    Not sure what this means…
    Craig

  2. I think the html table structure you are trying to show it in flex will be similar to this structure

    row 1 column 1
    row 1 column 2

    row 2 column 1
    row 2 column 2

    I have used regular expression for filtering the required html table sections.

    First i have used a regular expression to filter the tag. When that regex is applied to the string, the string will contain only the table information like the above one. This is the table expression to match the table tag from the rest of the html tags.

    Once we parse out the table structure, now we can look for the Rows( tags ). Again we use a regular expression on the string obtained ( this time an expression to filter rows). Now we will get an array of tags. In this case an array of length 2. The length of the array is the number of rows in the table.

    Now we have to loop through this array and again apply a regular expression to parse the tags . If we do that we will get an array conating the tds in that row. This contains the table data.

    You can store these arrays in a nested structure and use that structure to populate the flex grid component.

    I will try to post a code snippet next time so that you will get a better idea of what i am talking about

Leave a Reply