class Table {

    public String toHtml()
    {
        StringBuffer sb = new StringBuffer("<table");
        if (id != null)
        {
            sb.append(" id=\"" + id + "\"");
        }
        sb.append(">\n");
        if (caption != null)
        {
            sb.append(String.format("<caption>%s</caption>\n", caption));
        }
        for (TableRow tr : this.rows)
        {
            sb.append(tr.toHtml());
            sb.append("\n");
        }
        sb.append("</table>");
        return sb.toString();
    }

    public  Table();
    public  Table(String id, List<TableRow> rows, String caption);

}