HTML Tables

Brian Yennie briany at qldlearning.com
Wed Apr 19 04:08:20 EDT 2006


Bill,

If you *just* need row and column data and no formatting, how about 
something like:
(warning: untested email code)

## get source from a field
put fld "htmlSource" into tHTML

## translate end of row to end of line
replace "</tr>" with return in tHTML

## translate end of column to tab
replace "</td>" with tab in tHTML

## delete all the rest of the html tags
put replaceText(tHTML, "<[a-zA-Z/]+[^>]*>", empty) into tHTML

## remove trailing tabs and trailing return
replace tab&return with return
delete last char of tHTML

## put it in a new field
put tHTML into fld "tableField"


> Forgive me if this has been "asked and answered" on the list before, 
> but I
> think it's of general enough interest for me to post, in case someone 
> has
> already invented this mousetrap.
>
> I am wondering what the most efficient way might be to convert an HTML 
> table
> into a Rev table.
>
> The ideal solution would
>
> - convert <tr>'s into rows and <td>'s into columns
> - correctly handle (i.e., ignore) all of the various attributes that 
> might
> be embedded within the table tags.
> - designed for data tables (not formatting tables)
> - work very fast
>
> Ideas? Suggestions? Pointers?
>
> - Bill
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>




More information about the use-livecode mailing list