021-table-percent.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>021 table percentage columns</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 { height: 24px; color: #ffffff; }
  15. .red { background: #cc3333; }
  16. .blue { background: #2244cc; }
  17. .after { background: #333333; color: #ffffff; height: 24px; margin-top: 8px; padding-left: 4px; }
  18. </style>
  19. </head>
  20. <body>
  21. <h1>021 &middot; table percentage columns</h1>
  22. <p>The red cell must be 30% and the blue cell 70% of the table in both panes.</p>
  23. <div class="pane">
  24. <div class="label">A: 30% / 70%</div>
  25. <div class="stage">
  26. <table style="width: 422px">
  27. <tr><td class="red" style="width: 30%">30%</td><td class="blue" style="width: 70%">70%</td></tr>
  28. </table>
  29. <div class="after">after</div>
  30. </div>
  31. </div>
  32. <div class="pane">
  33. <div class="label">B: 126px / 296px reference</div>
  34. <div class="stage">
  35. <table style="width: 422px">
  36. <tr><td class="red" style="width: 126px">30%</td><td class="blue" style="width: 296px">70%</td></tr>
  37. </table>
  38. <div class="after">after</div>
  39. </div>
  40. </div>
  41. </body>
  42. </html>