ZVON > References > DOM2 Reference

createTHead (method )

Owning interface and usage:  
HTMLTableElement.createTHead()

Member of these other interfaces:  
none

Description:  
Create a table header row or return an existing one.

Parameters:  
none

Returns:  
HTMLElement -  A new table header element (THEAD).

Exceptions:  
none


Example:
Source:
  <TABLE id="testTable" border="2" frame="hsides" rules="groups" summary="Code page support in different versions of MS Windows.">
    <CAPTION>CODE-PAGE SUPPORT IN MICROSOFT WINDOWS</CAPTION>
    <COLGROUP align="center"></COLGROUP>
    <COLGROUP align="left"></COLGROUP>
    <COLGROUP align="center" span="2"></COLGROUP>
    <COLGROUP align="center" span="3"></COLGROUP>
    <THEAD valign="top">
      <TR>
        <TH>Code-Page<BR></BR>ID</TH>
        <TH>Name</TH>
        <TH>ACP</TH>
        <TH>OEMCP</TH>
        <TH>Windows<BR></BR>NT 3.1</TH>
        <TH>Windows<BR></BR>NT 3.51</TH>
        <TH>Windows<BR></BR>95</TH>
      </TR>
    </THEAD>
    <TBODY>
      <TR><TD>1200</TD><TD>Unicode (BMP of ISO/IEC-10646)</TD><TD></TD><TD></TD><TD>X</TD><TD>X</TD><TD>*</TD></TR>
      <TR><TD>1250</TD><TD>Windows 3.1 Eastern European</TD><TD>X</TD><TD></TD><TD>X</TD><TD>X</TD><TD>X</TD></TR>
      <TR><TD>1251</TD><TD>Windows 3.1 Cyrillic</TD><TD>X</TD><TD></TD><TD>X</TD><TD>X</TD><TD>X</TD></TR>
      <TR><TD>1252</TD><TD>Windows 3.1 US (ANSI)</TD><TD>X</TD><TD></TD><TD>X</TD><TD>X</TD><TD>X</TD></TR>
      <TR><TD>1253</TD><TD>Windows 3.1 Greek</TD><TD>X</TD><TD></TD><TD>X</TD><TD>X</TD><TD>X</TD></TR>
      <TR><TD>1254</TD><TD>Windows 3.1 Turkish</TD><TD>X</TD><TD></TD><TD>X</TD><TD>X</TD><TD>X</TD></TR>
      <TR><TD>1255</TD><TD>Hebrew</TD><TD>X</TD><TD></TD><TD></TD><TD></TD><TD>X</TD></TR>
      <TR><TD>1256</TD><TD>Arabic</TD><TD>X</TD><TD></TD><TD></TD><TD></TD><TD>X</TD></TR>
      <TR><TD>1257</TD><TD>Baltic</TD><TD>X</TD><TD></TD><TD></TD><TD></TD><TD>X</TD></TR>
      <TR><TD>1361</TD><TD>Korean (Johab)</TD><TD>X</TD><TD></TD><TD></TD><TD>**</TD><TD>X</TD></TR>
    </TBODY>
    <TBODY>
      <TR><TD>437</TD><TD>MS-DOS United States</TD><TD></TD><TD>X</TD><TD>X</TD><TD>X</TD><TD>X</TD></TR>
      <TR><TD>708</TD><TD>Arabic (ASMO 708)</TD><TD></TD><TD>X</TD><TD></TD><TD></TD><TD>X</TD></TR>
      <TR><TD>709</TD><TD>Arabic (ASMO 449+, BCON V4)</TD><TD></TD><TD>X</TD><TD></TD><TD></TD><TD>X</TD></TR>
      <TR><TD>710</TD><TD>Arabic (Transparent Arabic)</TD><TD></TD><TD>X</TD><TD></TD><TD></TD><TD>X</TD></TR>
      <TR><TD>720</TD><TD>Arabic (Transparent ASMO)</TD><TD></TD><TD>X</TD><TD></TD><TD></TD><TD>X</TD></TR>
    </TBODY>
    <TFOOT>
      <TR>
        <TH colspan="7">( SAMPLE TABLE taken from HTML4.01 specification )</TH>
      </TR>
    </TFOOT>
  </TABLE>
JavaScript:
  function createTHeadOnTable() {
    var main = document.getElementById('testTable');
    var el = main.createTHead();
    alert( el );
  }
Try it:  
See it:
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200 Unicode (BMP of ISO/IEC-10646) X X *
1250 Windows 3.1 Eastern European X X X X
1251 Windows 3.1 Cyrillic X X X X
1252 Windows 3.1 US (ANSI) X X X X
1253 Windows 3.1 Greek X X X X
1254 Windows 3.1 Turkish X X X X
1255 Hebrew X X
1256 Arabic X X
1257 Baltic X X
1361 Korean (Johab) X ** X
437 MS-DOS United States X X X X
708 Arabic (ASMO 708) X X
709 Arabic (ASMO 449+, BCON V4) X X
710 Arabic (Transparent Arabic) X X
720 Arabic (Transparent ASMO) X X
( SAMPLE TABLE taken from HTML4.01 specification )