/** * Adds a header row to the table. can be used to give a table some title. * * <pre> * addHeader("hello",'.',NiceTable.LEFT) * would produce a row like * ... hello .......................... * {rows in here.} * </pre> * * @param title * the string to display as a header * @param mark * the mark to use for the rest of the column * @param orientation * the orientation of the header column. */ public void addHeader(final String title, final char mark, final Alignment orientation) { final Header header = new Header(title, mark, orientation, this); rows.add(header); }
/** * {@inheritDoc} */ @Override public String draw() { return Util.combine(new String(new char[] { AbstractTabularComponent.BORDER }), Util.pad(title, enclosing, getTable().getTotalWidth() - 2, orientation), new String(new char[] { AbstractTabularComponent.BORDER }), NEWLINE); }