Specify rules for a table : JavaScript DHTML examples (example source code) » HTML » Table

JavaScript DHTML
C++
Java Products
Java Articles
JavaScript DHTML Home  »   HTML   » [  Table  ]   
 



Specify rules for a table

Please note that some example is only working under IE or Firefox.

<html>
<head>
<script type="text/javascript">
function rowRules(){
    document.getElementById('myTable').rules="rows"
}
function colRules(){
    document.getElementById('myTable').rules="cols"
}
</script>
</head>

<body>
<table id="myTable" border="1">
    <tr>
        <td>d</td>
        <td>d</td>
    </tr>
    <tr>
        <td>d</td>
        <td>d</td>
    </tr>
    <tr>
        <td>Row3 cell1</td>
        <td>Row3 cell2</td>
    </tr>
    <tr>
        <td>Row4 cell1</td>
        <td>Row4 cell2</td>
    </tr>
    <tr>
        <td>Row5 cell1</td>
        <td>Row5 cell2</td>
    </tr>
</table>
<form>
<input type="button" onclick="rowRules()" value="Show row borders">
<input type="button" onclick="colRules()" value="Show col borders">
</form>
</body>

</html>
Related examples in the same category
1.  Tabular data in Javascript with hyper link
2.  Change the width of a table border
3.  Change the cellPadding and cellSpacing of a table
4.  Specify frames of a table
5.  Change table row height
6.  Create table caption
7.  Deleting table rows
8.  Adding table rows
9.  Align the cell content in a table row
10.  Change the cell content in a table row
11.  Vertical align the cell content in a table row
12.  Align the cell content in a single cell
13.  Vertical align the cell content in a single cell
14.  Adding cells to a table row
15.  Change the colspan of a table row
16.  Insert table row: the uniqueID Property
17.  Using the cloneNode Method
18.  Cycling Through Table frame Property Values
19.  Replacing Table Cell Content
20.  Inserting/Removing Row Elements
21.  Modifying Table Columns
22.  Accessing userProfile Data
23.  Cycling Through Table rows Property Values
24.  Using the Data Binding record Number Property
25.  Using the offsetParent Property
26.  Transforming JavaScript Data into HTML Tables
27.  Transforming JavaScript Data into HTML Tables with HyperLink








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.