टेबल क्रिएट टीफूट () मेथड
उदाहरण
एक <tfoot> तत्व बनाएं (और इसमें <tr> और <td> तत्व डालें):
// Find a <table> element with id="myTable":
var table = document.getElementById("myTable");
// Create an empty <tfoot> element and add it to the table:
var footer = table.createTFoot();
// Create an empty <tr> element and add it to the first position of <tfoot>:
var row = footer.insertRow(0);
// Insert a new cell (<td>) at the first position of the "new" <tr> element:
var cell = row.insertCell(0);
// Add some bold text in the new cell:
cell.innerHTML = "<b>This is a table footer</b>";
परिभाषा और उपयोग
createTFoot () विधि एक खाली <tfoot> तत्व बनाता है और इसे तालिका में जोड़ता है।
नोट: यदि कोई <tfoot> तत्व पहले से ही टेबल पर मौजूद है, तो createTFoot () विधि मौजूदा को वापस कर देती है, और एक नया नहीं बनाती है।
नोट: <tfoot> तत्व के अंदर एक या अधिक <tr> टैग होने चाहिए।
युक्ति: किसी तालिका से <tfoot> तत्व को निकालने के लिए, deleteTFoot() विधि का उपयोग करें।
ब्राउज़र समर्थन
Method | |||||
---|---|---|---|---|---|
createTFoot() | Yes | Yes | Yes | Yes | Yes |
वाक्य - विन्यास
tableObject.createTFoot()
मापदंडों
कोई नहीं |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | नव निर्मित (या मौजूदा) <tfoot> तत्व |
---|
और ज्यादा उदाहरण
उदाहरण
एक <tfoot> तत्व बनाएं और हटाएं:
function myCreateFunction() {
var table = document.getElementById("myTable");
var footer = table.createTFoot();
var row = footer.insertRow(0);
var cell = row.insertCell(0);
cell.innerHTML = "<b>This is a table footer</b>";
}
function myDeleteFunction() {
document.getElementById("myTable").deleteTFoot();
}
संबंधित पृष्ठ
HTML संदर्भ: HTML <tfoot> टैग
टेबल ऑब्जेक्ट