com.ibm.as400.util.html

Class HTMLTableHeader

  • All Implemented Interfaces:
    HTMLConstants, HTMLTagElement, java.io.Serializable


    public class HTMLTableHeader
    extends HTMLTableCell
    The HTMLTableHeader represents an HTML table header tag.

    This example creates an HTMLTableHeader and displays the tag output.

      HTMLTableHeader header = new HTMLTableHeader();
      header.setHorizontalAlignment(HTMLTableHeader.CENTER);
      HTMLText headerText = new HTMLText("Customer Name");
      header.setElement(headerText);
      System.out.println(header.getTag());
      
    Here is the output of the tag:
      <th align="center">Customer Name</th>
      

    Calling getFOTag() produces the following tag with the default cell border and padding properties:

      <fo:table-cell border-style='solid' border-width='1px' padding='1px'>
      <fo:block font-weight='bold'><fo:block>Customer Name</fo:block>
      </fo:block>
      </fo:table-cell>
      
    See Also:
    Serialized Form
    • Constructor Detail

      • HTMLTableHeader

        public HTMLTableHeader()
        Constructs a default HTMLTableHeader object.
      • HTMLTableHeader

        public HTMLTableHeader(HTMLTagElement element)
        Constructs an HTMLTableHeader object with the specified data element.
        Parameters:
        element - An HTMLTagElement object containing the data.
    • Method Detail

      • getFOTag

        public java.lang.String getFOTag(HTMLTagElement element)
        Returns the table header tag with the specified data element.
        Overrides:
        getFOTag in class HTMLTableCell
        Parameters:
        element - The table cell element.
        Returns:
        The XSL-FO tag.
      • getTag

        public java.lang.String getTag(HTMLTagElement element)
        Returns the table header tag with the specified data element.
        Overrides:
        getTag in class HTMLTableCell
        Parameters:
        element - The table cell element.
        Returns:
        The HTML tag.
      • isUseFO

        public boolean isUseFO()
        Returns if Formatting Object tags are outputted. The default value is false.
        Overrides:
        isUseFO in class HTMLTableCell
        Returns:
        true if the output generated is an XSL formatting object, false if the output generated is HTML.
      • setBorderWidth

        public void setBorderWidth(int borderWidth)
        Sets the border width in pixels. A value of zero indicates no border. The default value is one.
        Overrides:
        setBorderWidth in class HTMLTableCell
        Parameters:
        borderWidth - The border width.
      • setCellPadding

        public void setCellPadding(int cellPadding)
        Sets the global table cell padding. The cell padding is the spacing between data in a table cell and the border of the cell. The default value is 1
        Overrides:
        setCellPadding in class HTMLTableCell
        Parameters:
        cellPadding - The cell padding.
      • setUseFO

        public void setUseFO(boolean useFO)
        Sets if Formatting Object tags should be used. The default value is false.
        Overrides:
        setUseFO in class HTMLTableCell
        Parameters:
        useFO - - true if output generated is an XSL formatting object, false if the output generated is HTML.
      • toString

        public java.lang.String toString()
        Returns the HTML table header tag.
        Overrides:
        toString in class HTMLTableCell
        Returns:
        The header tag.