tree_to_table

one of the documented procedures in this installation of the ACS
Usage:
tree_to_table   tree
What it does:
generates a table display of a given tree
Defined in: /web/philip/tcl/ad-trees.tcl

Source code:


    set h [tree_height $tree]
    set result "<table border>\n"
    for {set level 0} {$level<$h} {incr level} {
	append result "<tr>\n"
	foreach subtree [tree_level $tree $level] {
	    if { [llength $subtree]==1 } {
		set rowspan [expr $h-$level]
	    } else {
		set rowspan 1
	    }	    
	    append result "  <td valign=top align=center rowspan=$rowspan colspan=[tree_width $subtree]>[head $subtree]</td>\n"	    
	}
	append result "</tr>\n"
    }
    append result "</table>\n"
    return $result


philg@mit.edu