Blogger Information
Blog 11
fans 0
comment 0
visits 6564
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
如何用table表格标签制作课程表和用ul>li>a或ul>li>a>img实现文本、图片的超链接
Feel Lonely
Original
486 people have browsed it

利用table标签制作课程表

  1. <style>
  2. table {
  3. width: 800px;
  4. border-collapse: collapse;
  5. }
  6. caption {
  7. padding: 15px 15px;
  8. font-size: 24px;
  9. font-weight: bold;
  10. }
  11. th,
  12. td {
  13. border: 1px solid #000;
  14. width: 100px;
  15. height: 25px;
  16. text-align: center;
  17. }
  18. </style>
  19. <table>
  20. <caption>
  21. 课程表
  22. </caption>
  23. <thead>
  24. <tr>
  25. <th colspan="3">时间</th>
  26. <th>星期一</th>
  27. <th>星期二</th>
  28. <th>星期三</th>
  29. <th>星期四</th>
  30. <th>星期五</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. <tr>
  35. <td rowspan="4">上午</td>
  36. <td>第一节</td>
  37. <td>8:30-9:10</td>
  38. <td rowspan="2">语文</td>
  39. <td rowspan="2">数学</td>
  40. <td rowspan="2">英语</td>
  41. <td rowspan="2">英语</td>
  42. <td rowspan="2">语文</td>
  43. </tr>
  44. <tr>
  45. <td>第二节</td>
  46. <td>9:20-10:00</td>
  47. </tr>
  48. <tr>
  49. <td>第三节</td>
  50. <td>10:15-10:55</td>
  51. <td rowspan="2">英语</td>
  52. <td rowspan="2">语文</td>
  53. <td rowspan="2">语文</td>
  54. <td rowspan="2">数学</td>
  55. <td rowspan="2">政治</td>
  56. </tr>
  57. <tr>
  58. <td>第四节</td>
  59. <td>11:00-11:45</td>
  60. </tr>
  61. <tr>
  62. <td colspan="8"></td>
  63. </tr>
  64. <tr>
  65. <td rowspan="4">上午</td>
  66. <td>第五节</td>
  67. <td>13:15-13:55</td>
  68. <td rowspan="2">数学</td>
  69. <td rowspan="2">英语</td>
  70. <td rowspan="2">地理</td>
  71. <td rowspan="2">化学</td>
  72. <td rowspan="2">数学</td>
  73. </tr>
  74. <tr>
  75. <td>第六节</td>
  76. <td>14:05-14:45</td>
  77. </tr>
  78. <tr>
  79. <td>第七节</td>
  80. <td>15:00-15:40</td>
  81. <td rowspan="2">化学</td>
  82. <td rowspan="2">生物</td>
  83. <td rowspan="2">数学</td>
  84. <td rowspan="2">语文</td>
  85. <td rowspan="2">英语</td>
  86. </tr>
  87. <tr>
  88. <td>第八节</td>
  89. <td>15:50-16:30</td>
  90. </tr>
  91. <tr>
  92. <td colspan="8"></td>
  93. </tr>
  94. <tr>
  95. <td rowspan="2">晚上</td>
  96. <td>第九节</td>
  97. <td>19:00-19:40</td>
  98. <td rowspan="2">生物</td>
  99. <td rowspan="2">物理</td>
  100. <td rowspan="2">历史</td>
  101. <td rowspan="2">政治</td>
  102. <td rowspan="2">体育</td>
  103. </tr>
  104. <tr>
  105. <td>第十节</td>
  106. <td>19:50-20:30</td>
  107. </tr>
  108. </tbody>
  109. </table>
  1. 重点:colspan 横向合并;rowspan纵向合并, border-collapse: collapse;合并表格边线!

ul>li>a>img实现导航超链接

  1. .num>ul>li>a>img 快速生成一个图片超链接
  1. <div class="num">
  2. <ul>
  3. <li><a href=""><img src="" alt=""></a></li>
  4. </ul>
  5. </div>
  1. li*4>a{栏目$@0} 快速生成四组<li>标签包裹<a>标签的文本超链接,并从0开始递增
  1. <li><a href="">栏目0</a></li>
  2. <li><a href="">栏目1</a></li>
  3. <li><a href="">栏目2</a></li>
  4. <li><a href="">栏目3</a></li>

实例

  1. <div class="num">
  2. <ul>
  3. <li><a href="https://www.php.cn"><img src="https://www.php.cn/static/images/new/logo.png" alt="PHP中文网"></a></li>
  4. <li><a href="https://www.php.cn">栏目1</a></li>
  5. <li><a href="https://www.php.cn">栏目2</a></li>
  6. <li><a href="https://www.php.cn">栏目3</a></li>
  7. <li><a href="https://www.php.cn">栏目4</a></li>
  8. </ul>
  9. </div>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:代码下附加效果图
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post