Home Javascript JavaScript deleteTFoot method
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

JavaScript deleteTFoot method

Advertisement
In the HTML table if we want to delete the table footer then we can delete this table footer by calling the JavaScript method with the table object.

JavaScript deleteTFoot method

     

In the HTML table if we want to delete the table footer then we can delete this table footer by calling the JavaScript method with the table object. Syntax for using deleteTFoot() method is as follows:

Syntax:

 tableObject.deleteTFoot();

Description of code:

In this sample example code we have created an html page which consists an html table with one header and one footer and we also have one button "Delete footer" who calls the JavaScript method "deleteTableFooter()". It gets element table object with the method getElementById() and then we can call the method deleteTFoot() on it. 

deleteTFootExample.html

<html>
<body>
<script language="JavaScript">
function deleteTableFooter() {
var footer = document.getElementById('table').deleteTFoot();
}
</script>

<p align="center">&nbsp;</p>
<div style="background: #cf2255; width:'100%';" align="center">
<font color="#ffffcc" size="12pt"><b>Deleting Table Footer</b></font></div>
<center>
<table id="table" border="1" width="400">
<thead>
<th colspan="2"> Information table Header </th>
</thead>
<tr>
<td>Name</td>
<td>Deepak Kumar</td>
</tr>

<tr>
<td>Designation</td>
<td>IT Manager</td>
</tr>
<tfoot>
<th colspan="2"> 
<font color="#565656" size="5pt">
Information table Footer 
</font>
</th>
</tfoot>
</table>
</center>
<p>
<center>
<input type="button" value="Delete footer" onclick="deleteTableFooter(); this.disabled='true'">
</center>
</p>
</body>
</html>

Output:

Download Source Code

     

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 29, 2009

Ask Questions?    Discuss: JavaScript deleteTFoot method  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com