Example usage for com.google.gwt.user.client DOM createTH

List of usage examples for com.google.gwt.user.client DOM createTH

Introduction

In this page you can find the example usage for com.google.gwt.user.client DOM createTH.

Prototype

public static Element createTH() 

Source Link

Document

Creates an HTML TH element.

Usage

From source file:com.apress.progwt.client.college.gui.ext.TableWithHeaders.java

License:Apache License

/**
 * /*from   w  ww. j  ava  2 s. c  o m*/
 * @param rows
 * 
 * @param columns -
 *            Variable number of header columns
 * 
 */
public TableWithHeaders(int rows, String... columns) {

    super(rows, columns.length);

    Log.debug("TableWithHeaders.NEW GRID " + columns.length + " " + rows);

    // use DOM to create thead element....
    Element thead = DOM.createElement("thead");
    Element tr = DOM.createTR();

    // add columns
    DOM.appendChild(thead, tr);
    for (String columnName : columns) {
        Element th = DOM.createTH();
        DOM.appendChild(tr, th);

        // add some text to the header...
        DOM.setInnerText(th, columnName);
    }

    // get the table element
    Element table = this.getElement();

    // and add the thead before the tbody
    DOM.insertChild(table, thead, 0);
}

From source file:gwt.material.design.client.ui.table.TableHeader.java

License:Apache License

public TableHeader() {
    super(DOM.createTH());
}

From source file:gwt.material.design.client.ui.table.TableHeader.java

License:Apache License

public TableHeader(String classNames) {
    super(DOM.createTH(), classNames);
}

From source file:org.kuali.student.common.ui.client.widgets.table.SimpleWidgetTable.java

License:Educational Community License

public SimpleWidgetTable(List<String> columnNames) {
    Element thead = DOM.createElement("thead");
    Element tr = DOM.createTR();/*w w  w  .j  a  v  a 2  s. c  o  m*/
    int columnPercentage = 100 / columnNames.size();

    Element table = simpleTable.getElement();
    DOM.appendChild(thead, tr);
    for (String columnName : columnNames) {
        Element th = DOM.createTH();
        DOM.appendChild(tr, th);
        DOM.setInnerText(th, columnName);
        th.setAttribute("width", columnPercentage + "%");
    }

    DOM.insertChild(table, thead, 0);

    simpleTable.setWidth("100%");
    simpleTable.setStyleName("ks-table-plain");
    this.initWidget(simpleTable);

}

From source file:org.mcarthur.sandy.gwt.table.client.TableHeaderCell.java

License:Apache License

protected TableHeaderCell() {
    super(DOM.createTH());
    addStyleName(Constants.GWTSTUFF + "-TableHeaderCell");
}