JavaScript Reference/Javascript Properties/frame

Материал из Web эксперт
Перейти к: навигация, поиск

"frame" Example

    
<html>
<body>
<script>
    function function1() {
        document.getElementById("myTable").frame = "void";
    }
    function function2() {
        document.getElementById("myTable").frame = "above";
    }
    function function3() {
        document.getElementById("myTable").frame = "below";
    }
    function function4() {
        document.getElementById("myTable").frame = "border";
    }
    function function5() {
        document.getElementById("myTable").frame = "box";
    }
    function function6() {
        document.getElementById("myTable").frame = "hsides";
    }
    function function7() {
        document.getElementById("myTable").frame = "lhs";
    }
    function function8() {
        document.getElementById("myTable").frame = "rhs";
    }
    function function9() {
        document.getElementById("myTable").frame = "vsides";
    }
</script>
<table id="myTable" width="542" bordercolor="blue" cellspacing="5" cellpadding="5">
    <tr>
        <td id="C1">Cell 1</td>
        <td>Cell 2</td>
        <td>Cell 3</td>
    </tr>
    <tr>
        <td id="C1">Cell 4</td>
        <td>Cell 5</td>
        <td>Cell 6</td>
    </tr>
</table>
<input type="button" value="Frame = "above"" onClick="function2();">
<input type="button" value="Frame = "below"" onClick="function3();">
<input type="button" value="Frame = "border"" onClick="function4();">
<input type="button" value="Frame = "box"" onClick="function5();">
<input type="button" value="Frame = "hsides"" onClick="function6();">
<input type="button" value="Frame = "lhw"" onClick="function7();">
<input type="button" value="Frame = "rhs"" onClick="function8();">
<input type="button" value="Frame = "vsides"" onClick="function9();">
<input type="button" value="Frame = "void"" onClick="function1();">
</body>
</html>



"frame" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<table>                                                       |
+----------------+--------------------------------------------------------------+



"frame" Possible Values

Possible Values
void, 
above, 
below, 
border, 
box, 
hsides, 
lhs, 
rhs, 
vsides.



"frame" Syntax and Note

Note:
Read and write property. 
How is the table border rendered. 
    
Syntax:
    
document.getElementById("tableID").frame = value
document.all.tableID.frame = value // IE only