Tablo createCaption() Yöntemi
Örnek
Bir tablo için metin içeren bir <caption> öğesi oluşturun:
var table = document.getElementById("myTable").createCaption();
table.innerHTML = "<b>My table caption</b>";
Tanım ve Kullanım
createCaption() yöntemi, boş bir <caption> öğesi oluşturur ve onu tabloya ekler.
Not: Tabloda zaten bir <caption> öğesi varsa, createCaption() yöntemi mevcut olanı döndürür ve yeni bir öğe oluşturmaz.
İpucu: Bir tablodan <caption> öğesini kaldırmak için deleteCaption() yöntemini kullanın.
Tarayıcı Desteği
Method | |||||
---|---|---|---|---|---|
createCaption() | Yes | Yes | Yes | Yes | Yes |
Sözdizimi
tableObject.createCaption()
parametreler
Hiçbiri |
Teknik detaylar
Geri dönüş değeri: | Yeni oluşturulan (veya mevcut) bir <caption> öğesi |
---|
Daha fazla örnek
Örnek
Bir <caption> öğesi oluşturun ve silin:
function myCreateFunction() {
var table = document.getElementById("myTable").createCaption();
table.innerHTML = "<b>My table caption</b>";
}
function myDeleteFunction() {
document.getElementById("myTable").deleteCaption();
}
İlgili Sayfalar
HTML referansı: HTML <caption> etiketi
❮ Tablo Nesnesi