但行好事莫问前程 学习笔记

  1. [但行好事莫问前程 学习笔记][Link 1]

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0luSmF2YVdlVHJ1c3Q_size_16_color_FFFFFF_t_70

  1. <html>
  2. <head>
  3. <style>
  4. body {
  5. font-family: "Helvetica","Arial",sans-serif;
  6. background-color: #fff;
  7. color: #000;
  8. }
  9. table {
  10. margin: auto; /*元素水平居中*/
  11. border: 1px solid #9cc;
  12. }
  13. caption {
  14. background-color: brown;
  15. color: white;
  16. font-weight: bold;
  17. font-size: 20px;
  18. }
  19. th {
  20. background-color: #9cc;
  21. color: red;
  22. font-style: italic;
  23. font-size: 15px;
  24. }
  25. tr {
  26. border: 1px solid
  27. }
  28. tbody tr:hover {
  29. font-weight: bold
  30. }
  31. td, th {
  32. width: 150px;
  33. padding: 0
  34. }
  35. div {
  36. position: absolute;
  37. left: 50%;
  38. }
  39. h2 {
  40. text-align: center;
  41. }
  42. </style>
  43. <script>
  44. function trColor() {
  45. var _tbody = document.getElementsByTagName("tbody")[0];
  46. var trList = _tbody.children;
  47. //var trList = _tbody.childNodes;
  48. //alert(trList.length);
  49. for (var i = 0; i < trList.length; i++) {
  50. if (i % 2 == 0) {
  51. trList[i].style.backgroundColor = "pink";
  52. }
  53. }
  54. var whereH2 = document.createElement("h2");
  55. var whereText = document.createTextNode("Where");
  56. whereH2.appendChild(whereText);
  57. document.body.appendChild(whereH2);
  58. var abbrList = document.getElementsByTagName("abbr");
  59. //alert(abbrList.length);
  60. var abbrArray = new Array();
  61. for (var i = 0; i < abbrList.length; i++) {
  62. var key = abbrList[i].lastChild.nodeValue;
  63. var value = abbrList[i].getAttribute("title");
  64. //alert(key + " --- " + value);
  65. abbrArray[key] = value;
  66. }
  67. var _div = document.createElement("div");
  68. var dlList = document.createElement("dl");
  69. for (key in abbrArray) {
  70. var _dt = document.createElement("dt");
  71. var dtText = document.createTextNode(key);
  72. _dt.appendChild(dtText);
  73. var _dd = document.createElement("dd");
  74. var ddText = document.createTextNode(abbrArray[key]);
  75. _dd.appendChild(ddText);
  76. dlList.appendChild(_dt);
  77. dlList.appendChild(_dd);
  78. }
  79. _div.appendChild(dlList);
  80. document.body.appendChild(_div);
  81. }
  82. window.onload = trColor;
  83. </script>
  84. </head>
  85. <body>
  86. <table>
  87. <caption>巡视</caption>
  88. <thead>
  89. <tr>
  90. <th>when</th>
  91. <th>where</th>
  92. </tr>
  93. </thead>
  94. <tbody>
  95. <tr>
  96. <td>1949-09-09</td>
  97. <td><abbr title="去厦门旅行">胡建</abbr></td>
  98. </tr>
  99. <tr>
  100. <td>1978-06-13</td>
  101. <td><abbr title="去兰州吃拉面">甘肃</abbr></td>
  102. </tr>
  103. <tr>
  104. <td>1966-11-25</td>
  105. <td><abbr title="去哈尔滨滑哧溜">黑龙江</abbr></td>
  106. </tr>
  107. <tr>
  108. <td>1999-09-12</td>
  109. <td><abbr title="去天津听相声">天津</abbr></td>
  110. </tr>
  111. <tr>
  112. <td>1979-03-04</td>
  113. <td><abbr title="去深圳画圈">广东</abbr></td>
  114. </tr>
  115. </tbody>
  116. </table>
  117. </body>
  118. </html>

发表评论

表情:
评论列表 (有 0 条评论,6人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Shells命令学习笔记

    检索工具 每个命令都有很详细甚至繁琐的参数,此文只演示简单的使用示例。具体参数以及使用方式可以参照以下四种方式检索: 这个网站可以查询一部分命令: [explai