HTML DOM 표 프레임 속성
정의 및 사용
속성 세트를 프레임 또는 테두리 밖에있는 테이블을 리턴합니다.
문법
프레임 속성 설정 :
tableObject.frame="void|above|below|hsides|vsides|lhs|rhs|box|border"
위로 프레임 속성 :
tableObject.frame
值 | 描述 |
---|---|
void | 不显示外边界。默认。 |
above | 显示顶部外边框 |
below | 显示底部外边框 |
hsides | 显示顶部与底部外边框 |
vsides | 显示左侧与右侧的外边框 |
lhs | 显示左侧外边框 |
rhs | 显示右侧的外边框 |
box | 显示四个方向的外边框 |
border | 显示四边的外边框 |
브라우저 지원
모든 주요 브라우저는 프레임 속성을 지원
예
예
다음의 예는 국경의 두 가지 형태를 설정합니다 :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function above(){
document.getElementById('myTable').frame="above";
}
function below(){
document.getElementById('myTable').frame="below";
}
</script>
</head>
<body>
<table id="myTable" border="1">
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
<tr>
<td>cell 3</td>
<td>cell 4</td>
</tr>
</table>
<br>
<button type="button" onclick="above()">显示上面的边框</button>
<button type="button" onclick="below()">显示底部边框</button>
<p><b>Note:</b>frame属性在Internet Explorer 9之前版本不能正常显示。</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function above(){
document.getElementById('myTable').frame="above";
}
function below(){
document.getElementById('myTable').frame="below";
}
</script>
</head>
<body>
<table id="myTable" border="1">
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
<tr>
<td>cell 3</td>
<td>cell 4</td>
</tr>
</table>
<br>
<button type="button" onclick="above()">显示上面的边框</button>
<button type="button" onclick="below()">显示底部边框</button>
<p><b>Note:</b>frame属性在Internet Explorer 9之前版本不能正常显示。</p>
</body>
</html>
»시도
표 개체