@Override
	public final String generateHtmlCode() {

		final StringBuilder sb = new StringBuilder();

		sb.append("<!-- TableHelper Generated Code -->\n");
		sb.append("<table " + "cellpadding=\"0\" cellspacing=\"0\" " + "id=\""
				+ this.tableHtmlId + "\" " + "class=\"" + this.tableHtmlClass
				+ "\">\n");

		if (this.vertical) {

			for (final Iterator<Column> it = this.columns.iterator(); it
					.hasNext();) {
				final Column c = it.next();
				sb.append("\t<tr>\n");
				// Header
				sb.append("\t\t<th>" + c.header + "</th>\n");

				// Contents
				for (final Iterator<T> cit = this.contents.iterator(); cit
						.hasNext();) {
					final T t = cit.next();
					sb.append("\t\t<td>" + c.getString(t) + "</td>\n");
				}

				sb.append("\t</tr>\n");
			}

		} else {

			// Print headers
			sb.append("\t<tr>\n");
			for (final Iterator<Column> it = this.columns.iterator(); it
					.hasNext();) {
				final Column c = it.next();
				sb.append("\t\t<th>" + c.header + "</th>\n");
			}
			sb.append("\t</tr>\n");

			// Print contents
			for (final Iterator<T> it = this.contents.iterator(); it.hasNext();) {
				final T t = it.next();

				sb.append("\t<tr>\n");
				for (final Iterator<Column> cit = this.columns.iterator(); cit
						.hasNext();) {
					final Column c = cit.next();
					sb.append("\t\t<td>" + c.getString(t) + "</td>\n");
				}
				sb.append("\t</tr>\n");

			}

		}

		sb.append("</table>\n");
		return sb.toString();
	}