package html;

sub table {
	my $cols = shift;
	my @td = map { "<td>$_</td>" } @_;
	my $html = qq{<table>\n<tr>};
	foreach ( 0 .. $#td ) {
			$html .= $td[$_];
			$html .= qq{</tr>\n<tr>} if $_ % $cols == 1;
	}
	$html .= qq{</tr>\n</table>};
}

sub tabs {
	return unless @_;
	my $html = qq{<table border=1>\n<tr>};
	foreach my $row ( @_ ) {
		$row =~ s{\t}{</td><td>}g;
		$html .= qq|<tr><td>$row</td><tr>\n|;
	}
	$html .= qq|</table>|;
	return $html;
}
	

sub tt {
	qq|<tt>| . join(' ', @_) . qq|</tt>|;
}

warn "loaded";

1;
