030-rowspan.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>030 table rowspan</title>
  6. <style>
  7. html, body { margin: 0; padding: 0; background: #ffffff; color: #202020; }
  8. body { font-family: sans-serif; font-size: 13px; }
  9. h1 { font-size: 20px; margin: 10px 0 4px 10px; }
  10. p { margin: 0 0 10px 10px; }
  11. .pane { float: left; width: 440px; margin-left: 10px; }
  12. .label { background: #eeeeee; padding: 4px 6px; margin-bottom: 4px; }
  13. .stage { background: #ffffff; padding: 8px; border: 1px solid #999999; }
  14. td { padding: 0; }
  15. .red { background: #cc3333; }
  16. .blue { background: #2244cc; }
  17. .green { background: #22aa44; }
  18. .cover { position: relative; width: 300px; height: 70px; }
  19. .box { position: absolute; }
  20. .after { background: #333333; color: #ffffff; height: 24px; margin-top: 8px; padding-left: 4px; }
  21. </style>
  22. </head>
  23. <body>
  24. <h1>030 &middot; table rowspan</h1>
  25. <p>The red cell must span both rows (70 px), beside a 30 px blue cell and a 40 px green cell.</p>
  26. <div class="pane">
  27. <div class="label">A: rowspan=2</div>
  28. <div class="stage">
  29. <table style="width: 300px">
  30. <tr><td class="red" rowspan="2" style="width: 100px"></td><td class="blue" style="height: 30px"></td></tr>
  31. <tr><td class="green" style="height: 40px"></td></tr>
  32. </table>
  33. <div class="after">after</div>
  34. </div>
  35. </div>
  36. <div class="pane">
  37. <div class="label">B: absolute reference</div>
  38. <div class="stage">
  39. <div class="cover">
  40. <div class="box red" style="left: 0; top: 0; width: 100px; height: 70px"></div>
  41. <div class="box blue" style="left: 100px; top: 0; width: 200px; height: 30px"></div>
  42. <div class="box green" style="left: 100px; top: 30px; width: 200px; height: 40px"></div>
  43. </div>
  44. <div class="after">after</div>
  45. </div>
  46. </div>
  47. </body>
  48. </html>