博客列表 >1017作业课程表-表格-斜线表头-圆角表格

1017作业课程表-表格-斜线表头-圆角表格

陈翔
陈翔原创
2022年10月18日 12:37:54823浏览

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <style>
  9. table, th, td {border: 1px solid black;margin:auto;text-align:center;}
  10. table {border-collapse: collapse;}
  11. td,th{width: 100px;height: 50px;}
  12. .c11{background: rgb(198, 224, 180);}​​
  13. </style>
  14. </head>
  15. <body>
  16. <table border="1">
  17. <tr>
  18. <th colspan="8">课程表</th>
  19. </tr>
  20. <tr class="c11">
  21. <td colspan="2">时间星期</td>
  22. <td>星期一</td>
  23. <td>星期二</td>
  24. <td>星期三</td>
  25. <td>星期四</td>
  26. <td>星期五</td>
  27. <td>星期六</td>
  28. </tr>
  29. <tr>
  30. <td colspan="2">早晨<br>07:00-07:50</td>
  31. <td>&nbsp;</td>
  32. <td>&nbsp;</td>
  33. <td>&nbsp;</td>
  34. <td>&nbsp;</td>
  35. <td>&nbsp;</td>
  36. <td>&nbsp;</td>
  37. </tr>
  38. <tr>
  39. <td rowspan="4">上午</td>
  40. <td>第一节<br>08:00-08:40</td>
  41. <td>&nbsp;</td>
  42. <td>&nbsp;</td>
  43. <td>&nbsp;</td>
  44. <td>&nbsp;</td>
  45. <td>&nbsp;</td>
  46. <td>&nbsp;</td>
  47. </tr>
  48. <tr>
  49. <td>第二节<br>08:50-09:30</td>
  50. <td>&nbsp;</td>
  51. <td>&nbsp;</td>
  52. <td>&nbsp;</td>
  53. <td>&nbsp;</td>
  54. <td>&nbsp;</td>
  55. <td>&nbsp;</td>
  56. </tr>
  57. <tr>
  58. <td>第三节<br>09:40-10:20</td>
  59. <td>&nbsp;</td>
  60. <td>&nbsp;</td>
  61. <td>&nbsp;</td>
  62. <td>&nbsp;</td>
  63. <td>&nbsp;</td>
  64. <td>&nbsp;</td>
  65. </tr>
  66. <tr>
  67. <td>第四节<br>10:30-11:20</td>
  68. <td>&nbsp;</td>
  69. <td>&nbsp;</td>
  70. <td>&nbsp;</td>
  71. <td>&nbsp;</td>
  72. <td>&nbsp;</td>
  73. <td>&nbsp;</td>
  74. </tr>
  75. <tr class="c11">
  76. <td colspan="8">午休<br>12:00-14:00</td>
  77. </tr>
  78. <tr>
  79. <td rowspan="3">下午</td>
  80. <td>第五节<br>14:00-14:40</td>
  81. <td>&nbsp;</td>
  82. <td>&nbsp;</td>
  83. <td>&nbsp;</td>
  84. <td>&nbsp;</td>
  85. <td>&nbsp;</td>
  86. <td>&nbsp;</td>
  87. </tr>
  88. <tr>
  89. <td>第六节<br>14:50-15:30</td>
  90. <td>&nbsp;</td>
  91. <td>&nbsp;</td>
  92. <td>&nbsp;</td>
  93. <td>&nbsp;</td>
  94. <td>&nbsp;</td>
  95. <td>&nbsp;</td>
  96. </tr>
  97. <tr>
  98. <td>第七节<br>15:40-16:40</td>
  99. <td>&nbsp;</td>
  100. <td>&nbsp;</td>
  101. <td>&nbsp;</td>
  102. <td>&nbsp;</td>
  103. <td>&nbsp;</td>
  104. <td>&nbsp;</td>
  105. </tr>
  106. <tr class="c11">
  107. <td colspan="8">晚间<br>19:00-21:30</td>
  108. </tr>
  109. </table>
  110. </body>
  111. </html>

最终效果,斜线表头不会做

网上找的,加斜线表头

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <style>
  9. table, th, td {border: 1px solid black;margin:auto;text-align:center;}
  10. table {border-collapse: collapse;}
  11. td,th{width: 100px;height: 50px;}
  12. .c11{background: rgb(198, 224, 180);}
  13. .oblique-line {
  14. position: relative;
  15. width: 80px;
  16. line-height: 5px;
  17. text-align: left;
  18. }
  19. .oblique-line:before {
  20. content: "";
  21. position: absolute;
  22. width: 1px;
  23. height: 210px; /*斜线长度*/
  24. top: 0%;
  25. left: 0%;
  26. background-color: rgb(43, 39, 39);
  27. display: block;
  28. transform: rotate(-76deg); /*调整角度*/
  29. transform-origin: top;
  30. }
  31. .left-bottom-div {
  32. height: 22px;
  33. line-height: 22px;
  34. position: absolute;
  35. left: 4px;
  36. bottom: 0px;
  37. }
  38. .right-top-div {
  39. height: 22px;
  40. line-height: 22px;
  41. position: absolute;
  42. right: 4px;
  43. top: 0px;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <table border="1">
  49. <tr>
  50. <th colspan="8">课程表</th>
  51. </tr>
  52. <tr class="c11">
  53. <th class="oblique-line" colspan="2">
  54. <div>
  55. <div class="left-bottom-div">星期</div>
  56. <div class="right-top-div">时间</div>
  57. </div>
  58. </th>
  59. <td>星期一</td>
  60. <td>星期二</td>
  61. <td>星期三</td>
  62. <td>星期四</td>
  63. <td>星期五</td>
  64. <td>星期六</td>
  65. </tr>
  66. <tr>
  67. <td colspan="2">早晨<br>07:00-07:50</td>
  68. <td>&nbsp;</td>
  69. <td>&nbsp;</td>
  70. <td>&nbsp;</td>
  71. <td>&nbsp;</td>
  72. <td>&nbsp;</td>
  73. <td>&nbsp;</td>
  74. </tr>
  75. <tr>
  76. <td rowspan="4">上午</td>
  77. <td>第一节<br>08:00-08:40</td>
  78. <td>&nbsp;</td>
  79. <td>&nbsp;</td>
  80. <td>&nbsp;</td>
  81. <td>&nbsp;</td>
  82. <td>&nbsp;</td>
  83. <td>&nbsp;</td>
  84. </tr>
  85. <tr>
  86. <td>第二节<br>08:50-09:30</td>
  87. <td>&nbsp;</td>
  88. <td>&nbsp;</td>
  89. <td>&nbsp;</td>
  90. <td>&nbsp;</td>
  91. <td>&nbsp;</td>
  92. <td>&nbsp;</td>
  93. </tr>
  94. <tr>
  95. <td>第三节<br>09:40-10:20</td>
  96. <td>&nbsp;</td>
  97. <td>&nbsp;</td>
  98. <td>&nbsp;</td>
  99. <td>&nbsp;</td>
  100. <td>&nbsp;</td>
  101. <td>&nbsp;</td>
  102. </tr>
  103. <tr>
  104. <td>第四节<br>10:30-11:20</td>
  105. <td>&nbsp;</td>
  106. <td>&nbsp;</td>
  107. <td>&nbsp;</td>
  108. <td>&nbsp;</td>
  109. <td>&nbsp;</td>
  110. <td>&nbsp;</td>
  111. </tr>
  112. <tr class="c11">
  113. <td colspan="8">午休<br>12:00-14:00</td>
  114. </tr>
  115. <tr>
  116. <td rowspan="3">下午</td>
  117. <td>第五节<br>14:00-14:40</td>
  118. <td>&nbsp;</td>
  119. <td>&nbsp;</td>
  120. <td>&nbsp;</td>
  121. <td>&nbsp;</td>
  122. <td>&nbsp;</td>
  123. <td>&nbsp;</td>
  124. </tr>
  125. <tr>
  126. <td>第六节<br>14:50-15:30</td>
  127. <td>&nbsp;</td>
  128. <td>&nbsp;</td>
  129. <td>&nbsp;</td>
  130. <td>&nbsp;</td>
  131. <td>&nbsp;</td>
  132. <td>&nbsp;</td>
  133. </tr>
  134. <tr>
  135. <td>第七节<br>15:40-16:40</td>
  136. <td>&nbsp;</td>
  137. <td>&nbsp;</td>
  138. <td>&nbsp;</td>
  139. <td>&nbsp;</td>
  140. <td>&nbsp;</td>
  141. <td>&nbsp;</td>
  142. </tr>
  143. <tr class="c11">
  144. <td colspan="8">晚间<br>19:00-21:30</td>
  145. </tr>
  146. </table>
  147. </body>
  148. </html>

圆角表格

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>课程表-斜线表头-圆角表格</title>
  8. <style>
  9. table {
  10. border: 1px solid black;
  11. border-radius: 10px;
  12. border-collapse: collapse;
  13. border-style:hidden;
  14. margin:auto;
  15. text-align:center;
  16. box-shadow: 0 0 0 1px #700b0b;
  17. }
  18. td,th{
  19. width: 100px;
  20. height: 50px;
  21. border: 1px solid #631c1c;
  22. }
  23. .c1{background: rgb(198, 224, 180);}
  24. .oblique-line {
  25. position: relative;
  26. width: 80px;
  27. line-height: 5px;
  28. text-align: left;
  29. }
  30. .oblique-line:before {
  31. content: "";
  32. position: absolute;
  33. width: 1px;
  34. height: 210px; /*斜线长度*/
  35. top: 0%;
  36. left: 0%;
  37. background-color: rgb(43, 39, 39);
  38. display: block;
  39. transform: rotate(-76deg); /*调整角度*/
  40. transform-origin: top;
  41. }
  42. .left-bottom-div {
  43. height: 22px;
  44. line-height: 22px;
  45. position: absolute;
  46. left: 4px;
  47. bottom: 0px;
  48. }
  49. .right-top-div {
  50. height: 22px;
  51. line-height: 22px;
  52. position: absolute;
  53. right: 4px;
  54. top: 0px;
  55. }
  56. </style>
  57. </head>
  58. <body>
  59. <table>
  60. <tr>
  61. <th colspan="8">课程表</th>
  62. </tr>
  63. <tr class="c1">
  64. <td class="oblique-line" colspan="2">
  65. <div>
  66. <div class="left-bottom-div">星期</div>
  67. <div class="right-top-div">时间</div>
  68. </div>
  69. </td>
  70. <td>星期一</td>
  71. <td>星期二</td>
  72. <td>星期三</td>
  73. <td>星期四</td>
  74. <td>星期五</td>
  75. <td>星期六</td>
  76. </tr>
  77. <tr>
  78. <td colspan="2">早晨<br>07:00-07:50</td>
  79. <td>&nbsp;</td>
  80. <td>&nbsp;</td>
  81. <td>&nbsp;</td>
  82. <td>&nbsp;</td>
  83. <td>&nbsp;</td>
  84. <td>&nbsp;</td>
  85. </tr>
  86. <tr>
  87. <td rowspan="4">上午</td>
  88. <td>第一节<br>08:00-08:40</td>
  89. <td>&nbsp;</td>
  90. <td>&nbsp;</td>
  91. <td>&nbsp;</td>
  92. <td>&nbsp;</td>
  93. <td>&nbsp;</td>
  94. <td>&nbsp;</td>
  95. </tr>
  96. <tr>
  97. <td>第二节<br>08:50-09:30</td>
  98. <td>&nbsp;</td>
  99. <td>&nbsp;</td>
  100. <td>&nbsp;</td>
  101. <td>&nbsp;</td>
  102. <td>&nbsp;</td>
  103. <td>&nbsp;</td>
  104. </tr>
  105. <tr>
  106. <td>第三节<br>09:40-10:20</td>
  107. <td>&nbsp;</td>
  108. <td>&nbsp;</td>
  109. <td>&nbsp;</td>
  110. <td>&nbsp;</td>
  111. <td>&nbsp;</td>
  112. <td>&nbsp;</td>
  113. </tr>
  114. <tr>
  115. <td>第四节<br>10:30-11:20</td>
  116. <td>&nbsp;</td>
  117. <td>&nbsp;</td>
  118. <td>&nbsp;</td>
  119. <td>&nbsp;</td>
  120. <td>&nbsp;</td>
  121. <td>&nbsp;</td>
  122. </tr>
  123. <tr class="c1">
  124. <td colspan="8">午休<br>12:00-14:00</td>
  125. </tr>
  126. <tr>
  127. <td rowspan="3">下午</td>
  128. <td>第五节<br>14:00-14:40</td>
  129. <td>&nbsp;</td>
  130. <td>&nbsp;</td>
  131. <td>&nbsp;</td>
  132. <td>&nbsp;</td>
  133. <td>&nbsp;</td>
  134. <td>&nbsp;</td>
  135. </tr>
  136. <tr>
  137. <td>第六节<br>14:50-15:30</td>
  138. <td>&nbsp;</td>
  139. <td>&nbsp;</td>
  140. <td>&nbsp;</td>
  141. <td>&nbsp;</td>
  142. <td>&nbsp;</td>
  143. <td>&nbsp;</td>
  144. </tr>
  145. <tr>
  146. <td>第七节<br>15:40-16:40</td>
  147. <td>&nbsp;</td>
  148. <td>&nbsp;</td>
  149. <td>&nbsp;</td>
  150. <td>&nbsp;</td>
  151. <td>&nbsp;</td>
  152. <td>&nbsp;</td>
  153. </tr>
  154. <tr class="c1">
  155. <td colspan="8">晚间<br>19:00-21:30</td>
  156. </tr>
  157. </table>
  158. </body>
  159. </html>

底部背景增加圆角

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>课程表-斜线表头-圆角表格</title>
  8. <style>
  9. table {
  10. border: 1px solid black;
  11. border-radius: 10px 20px 20px 20px;
  12. border-collapse: collapse;
  13. border-style:hidden;
  14. margin:auto;
  15. text-align:center;
  16. box-shadow: 0 0 0 1px #1a1919;
  17. /* background: rgb(198, 224, 180); */
  18. }
  19. td,th{
  20. width: 100px;
  21. height: 50px;
  22. border: 1px solid #1b1919;
  23. }
  24. .c1{
  25. background: rgb(198, 224, 180);
  26. border-radius: 25px;
  27. }
  28. .c2{
  29. background-color: rgb(198, 224, 180);
  30. border-radius: 0px 0px 20px 20px;
  31. }
  32. .oblique-line {
  33. position: relative;
  34. width: 80px;
  35. line-height: 5px;
  36. text-align: left;
  37. }
  38. .oblique-line:before {
  39. content: "";
  40. position: absolute;
  41. width: 1px;
  42. height: 210px; /*斜线长度*/
  43. top: 0%;
  44. left: 0%;
  45. background-color: rgb(43, 39, 39);
  46. display: block;
  47. transform: rotate(-76deg); /*调整角度*/
  48. transform-origin: top;
  49. }
  50. .left-bottom-div {
  51. height: 22px;
  52. line-height: 22px;
  53. position: absolute;
  54. left: 4px;
  55. bottom: 0px;
  56. }
  57. .right-top-div {
  58. height: 22px;
  59. line-height: 22px;
  60. position: absolute;
  61. right: 4px;
  62. top: 0px;
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <table>
  68. <tr class="c0">
  69. <th colspan="8">课程表</th>
  70. </tr>
  71. <tr class="c1">
  72. <td class="oblique-line" colspan="2">
  73. <div>
  74. <div class="left-bottom-div">星期</div>
  75. <div class="right-top-div">时间</div>
  76. </div>
  77. </td>
  78. <td>星期一</td>
  79. <td>星期二</td>
  80. <td>星期三</td>
  81. <td>星期四</td>
  82. <td>星期五</td>
  83. <td>星期六</td>
  84. </tr>
  85. <tr>
  86. <td colspan="2">早晨<br>07:00-07:50</td>
  87. <td>&nbsp;</td>
  88. <td>&nbsp;</td>
  89. <td>&nbsp;</td>
  90. <td>&nbsp;</td>
  91. <td>&nbsp;</td>
  92. <td>&nbsp;</td>
  93. </tr>
  94. <tr>
  95. <td rowspan="4">上午</td>
  96. <td>第一节<br>08:00-08:40</td>
  97. <td>&nbsp;</td>
  98. <td>&nbsp;</td>
  99. <td>&nbsp;</td>
  100. <td>&nbsp;</td>
  101. <td>&nbsp;</td>
  102. <td>&nbsp;</td>
  103. </tr>
  104. <tr>
  105. <td>第二节<br>08:50-09:30</td>
  106. <td>&nbsp;</td>
  107. <td>&nbsp;</td>
  108. <td>&nbsp;</td>
  109. <td>&nbsp;</td>
  110. <td>&nbsp;</td>
  111. <td>&nbsp;</td>
  112. </tr>
  113. <tr>
  114. <td>第三节<br>09:40-10:20</td>
  115. <td>&nbsp;</td>
  116. <td>&nbsp;</td>
  117. <td>&nbsp;</td>
  118. <td>&nbsp;</td>
  119. <td>&nbsp;</td>
  120. <td>&nbsp;</td>
  121. </tr>
  122. <tr>
  123. <td>第四节<br>10:30-11:20</td>
  124. <td>&nbsp;</td>
  125. <td>&nbsp;</td>
  126. <td>&nbsp;</td>
  127. <td>&nbsp;</td>
  128. <td>&nbsp;</td>
  129. <td>&nbsp;</td>
  130. </tr>
  131. <tr class="c1">
  132. <td colspan="8">午休<br>12:00-14:00</td>
  133. </tr>
  134. <tr>
  135. <td rowspan="3">下午</td>
  136. <td>第五节<br>14:00-14:40</td>
  137. <td>&nbsp;</td>
  138. <td>&nbsp;</td>
  139. <td>&nbsp;</td>
  140. <td>&nbsp;</td>
  141. <td>&nbsp;</td>
  142. <td>&nbsp;</td>
  143. </tr>
  144. <tr>
  145. <td>第六节<br>14:50-15:30</td>
  146. <td>&nbsp;</td>
  147. <td>&nbsp;</td>
  148. <td>&nbsp;</td>
  149. <td>&nbsp;</td>
  150. <td>&nbsp;</td>
  151. <td>&nbsp;</td>
  152. </tr>
  153. <tr>
  154. <td>第七节<br>15:40-16:40</td>
  155. <td>&nbsp;</td>
  156. <td>&nbsp;</td>
  157. <td>&nbsp;</td>
  158. <td>&nbsp;</td>
  159. <td>&nbsp;</td>
  160. <td>&nbsp;</td>
  161. </tr>
  162. <tr>
  163. <td colspan="8" class="c2">晚间<br>19:00-21:30</td>
  164. </tr>
  165. </table>
  166. </body>
  167. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议