javascript createTHead() method


  Translation results:

create

UK[kriˈeɪt] 美[kriˈet]

vt. To produce; to create, to create; to ennoble, to ennoble...(noble)

vi.[English][Slang] Lose your temper, complain

Third person singular: creates Present participle: creating Past tense: created Past participle: created

head

英[hed] 美[hɛd]

n.Head; head; upper end; head, chief

vt. Use the top of the head; move forward; As the leader of...; standing at the front of...

vi. March towards...; set off; move in the direction of...; the ship sails to

adj. The head; in the front; the first;

at the top Third person singular: heads Plural: heads Present participle: heading Past tense: headed Past participle: headed

javascript createTHead() methodsyntax

Function:Used to get or create the <thead> element in the table.

Syntax: tableObject.createTHead()

Returns: Returns a TableSection, representing the <thead> element of the table. If the table already has a header, return it. If the table has no header, create a new, empty <thead> element, insert it into the table, and return it.

javascript createTHead() methodexample

<html>
<head>
<script type="text/javascript">
function createCaption()
{
var x=document.getElementById('myTable').createTHead()
x.innerHTML="My table head"
}
</script>
</head>
<body>

<table id="myTable" border="1">
<tr>
<td>Row1 cell1</td>
<td>Row1 cell2</td>
</tr>
<tr>
<td>Row2 cell1</td>
<td>Row2 cell2</td>
</tr>
</table>
<br />
<input type="button" onclick="createCaption()"
value="Create caption">

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance

Home

Videos

Q&A