src/ADT/Tree/BinaryNode.php
public function toTable()
	{
		$code = "<table cellspacing=1 cellpadding=0>\n<tr><td colspan=2 align=center><hr>".$this->value."</td></tr>";
		if( $this->left || $this->right )
		{
			$code .= "<tr><td align=center valign=top>";
			if( $this->left )
				$code .= $this->left->toTable();
			else
				$code .= "&nbsp;";
			$code .= "</td><td align=center valign=top>";
			if( $this->right )
				$code .= $this->right->toTable();
			else
				$code .= "&nbsp;";
			$code .= "</td></tr>\n";
		}
		$code .= "</table>\n";
		return $code;
	}
public function toTable()
	{
		$code = "<table cellspacing=1 cellpadding=0>\n<tr><td colspan=2 align=center><hr>".$this->value."</td></tr>";
		if( $this->left || $this->right )
		{
			$code .= "<tr><td align=center valign=top>";
			if( $this->left )
				$code .= $this->left->toTable();
			else
				$code .= "&nbsp;";
			$code .= "</td><td align=center valign=top>";
			if( $this->right )
				$code .= $this->right->toTable();
			else
				$code .= "&nbsp;";
			$code .= "</td></tr>\n";
		}
		$code .= "</table>\n";
		return $code;
	}
public function toTable ( ) { $ code = "<table cellspacing=1 cellpadding=0>\n<tr><td colspan=2 align=center><hr>" . $ this -> value . "</td></tr>" ; if ( $ this -> left || $ this -> right ) { $ code .= "<tr><td align=center valign=top>" ; if ( $ this -> left ) $ code .= $ this -> left -> toTable ( ) ; else $ code .= "&nbsp;" ; $ code .= "</td><td align=center valign=top>" ; if ( $ this -> right ) $ code .= $ this -> right -> toTable ( ) ; else $ code .= "&nbsp;" ; $ code .= "</td></tr>\n" ; } $ code .= "</table>\n" ; return $ code ; }
Returns the Tree as HTML-Table.
@access		public
@return		string
Returns the Tree as HTML - Table .