700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > html table运用方法 HTML Table caption用法及代码示例

html table运用方法 HTML Table caption用法及代码示例

时间:2020-06-23 01:13:35

相关推荐

html table运用方法 HTML Table caption用法及代码示例

表标题属性返回表的

元素,该元素用于定义表的标题。只能将一个标题分配给一个表,并且在元素内输入的标题默认为居中对齐。

用法

tableObject.caption

以下示例程序旨在说明表caption()属性:

例:提示标题元素内的文本。

Table caption Property in HTML

table,

td {

border:1px solid green;

}

h1 {

color:green;

}

h2 {

font-family:Impact;

}

body {

text-align:center;

}

GeeksforGeeks

Table caption Property

To return the caption element

for the table, double-click the

"Return Caption" button.

SubjectCourses

JavaFork JavaPythonFork PythonPlacementsSudo Placement

Return Caption

function Table_Caption() {

// Return caption using alert.

alert(document.getElementById(

"Courses").caption.innerHTML);

}

输出:

在单击按钮之前:

单击按钮后:

支持的浏览器:

苹果Safari

IE浏览器

Firefox

谷歌浏览器

Opera

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。