code: private void paintPaginationElement(final WDataTable table, final XmlStringBuilder xml) {
  		TableDataModel model = table.getDataModel();
  		xml.appendTagOpen("ui:pagination");
  
  			if (model instanceof TreeTableDataModel) {
  				// For tree tables, we only include top-level nodes for pagination.
  				TreeNode firstNode = ((TreeTableDataModel) model).getNodeAtLine(0);
  				xml.appendAttribute("rows", firstNode == null ? 0 : firstNode.getParent().
  						getChildCount());
  			} else {
  				xml.appendAttribute("rows", model.getRowCount());
  			}
  
  			xml.appendAttribute("rowsPerPage", table.getRowsPerPage());
  			xml.appendAttribute("currentPage", table.getCurrentPage());
  
  			switch (table.getPaginationMode()) {
  				case CLIENT:
  					xml.appendAttribute("mode", "client");
  					break;
  				case DYNAMIC:
  				case SERVER:
  					xml.appendAttribute("mode", "dynamic");
  					break;
  				case NONE:
  					break;
  				default:
  					throw new SystemException("Unknown pagination mode: " + table.
  							getPaginationMode());
  			}
  
  			xml.appendEnd();
  	}
docs: Paint the pagination aspects of the WDataTable.
  @param table the WDataTable being rendered
  @param xml the string builder in use