public static function buildTable( $rows, $attribs = array(), $headers = null ) {
		$s = self::openElement( 'table', $attribs );

		if( is_array( $headers ) ) {
			$s .= self::openElement( 'thead', $attribs );

			foreach( $headers as $id => $header ){
				$attribs = array();

				if( is_string( $id ) ) {
					$attribs['id'] = $id;
				}

				$s .= self::element( 'th', $attribs, $header );
			}
			$s .= self::closeElement( 'thead' );
		}

		foreach( $rows as $id => $row ){
			$attribs = array();

			if( is_string( $id ) ) {
				$attribs['id'] = $id;
			}

			$s .= self::buildTableRow( $attribs, $row );
		}

		$s .= self::closeElement( 'table' );

		return $s;
	}