HTML DOM axis 属性

定义和用法

axis 属性可设置或返回一个由逗号分隔的列表,其中包含了一组类型(有关联的单元格)的名称。

axis 属性可为某个单元格定义类型名称。

语法

  1. tabledataObject.axis=text

实例

下面的例子可返回单元格的 axis:

  1. <<html>
  2. <head>
  3. <script type="text/javascript">
  4. function alertAxis()
  5. {
  6. alert(document.getElementById('td3').axis);
  7. }
  8. </script>
  9. </head>
  10. <body>
  11.  
  12. <table border="1">
  13. <tr>
  14. <th>Firstname</th>
  15. <th>Lastname</th>
  16. <th>City</th>
  17. </tr>
  18. <tr>
  19. <td id="td1">Harry</td>
  20. <td id="td2">Potter</td>
  21. <td id="td3" axis="location">NY</td>
  22. </tr>
  23. <tr>
  24. <td id="td4">Peter</td>
  25. <td id="td5">Griffin</td>
  26. <td id="td6" axis="location">Las Vegas</td>
  27. </tr>
  28. </table>
  29. <br />
  30. <input type="button" onclick="alertAxis()"
  31. value="Alert axis" />
  32.  
  33. </body>
  34. </html>