JS實(shí)現(xiàn)為表格動(dòng)態(tài)添加標(biāo)題的方法
更新時(shí)間:2015年03月31日 10:30:36 作者:歐陽不瘋
這篇文章主要介紹了JS實(shí)現(xiàn)為表格動(dòng)態(tài)添加標(biāo)題的方法,涉及javascript中createCaption方法添加標(biāo)題的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
本文實(shí)例講述了JS實(shí)現(xiàn)為表格動(dòng)態(tài)添加標(biāo)題的方法。分享給大家供大家參考。具體如下:
JS中的表格對象帶有一個(gè)createCaption方法用于為表格創(chuàng)建標(biāo)題caption
<!DOCTYPE html>
<html>
<head>
<script>
function createCaption()
{
var x=document.getElementById('myTable').createCaption();
x.innerHTML="My table caption";
}
</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>
希望本文所述對大家的javascript程序設(shè)計(jì)有所幫助。
您可能感興趣的文章:
- js實(shí)現(xiàn)網(wǎng)頁標(biāo)題欄閃爍提示效果實(shí)例分析
- js實(shí)現(xiàn)的標(biāo)題欄新消息閃爍提示效果
- 一個(gè)JS函數(shù)搞定網(wǎng)頁標(biāo)題(title)閃動(dòng)效果
- 鼠標(biāo)滑在標(biāo)題上顯示圖片的JS代碼
- 拖動(dòng)table標(biāo)題實(shí)現(xiàn)改變td的大小(css+js代碼)
- 正則表達(dá)式提取網(wǎng)址、標(biāo)題、圖片等一例(.Net Asp Javascript/Js)的實(shí)現(xiàn)
- 復(fù)制本貼標(biāo)題和地址的js代碼
- 用js實(shí)現(xiàn)的打字效果的帶鏈接的新聞標(biāo)題
- JS實(shí)現(xiàn)超簡潔網(wǎng)頁title標(biāo)題跑動(dòng)閃爍提示效果代碼
相關(guān)文章
Add Formatted Text to a Word Document
Add Formatted Text to a Word Document...2007-06-06

