veracross/data-table

View on GitHub
assigments_table.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Data Tables Example</title>
    <style>
      table {
        border-collapse: collapse;
      }
      th, td {
          border: 1px solid black;
          padding: 10px 15px;
      }
      .data_table {width: 100%; empty-cells: show}
      .data_table td, .data_table th {padding: 3px}

      .data_table caption {font-size: 2em; font-weight: bold}

      .data_table thead {}
      .data_table thead th {background-color: #ddd; border-bottom: 1px solid #bbb;}

      .data_table tbody {}
      .data_table tbody tr.alt {background-color: #eee;}

      .data_table .group_header th {text-align: left;}

      .data_table .subtotal {}
      .data_table .subtotal td {border-top: 1px solid #000;}

      .data_table tfoot {}
      .data_table tfoot td {border-top: 1px solid #000;}

      .empty_data_table {text-align: center; background-color: #ffc;}

      /* Data Types */
      .data_table .number, .data_table .money {text-align: right}
      .data_table .text {text-align: left}

      [class^="level_"] {
        text-align: left
      }
      .level_0 th {
        padding-left: 0;
      }
      .level_1 th {
        padding-left: 35px;
      }
      .level_2 th {
        padding-left: 70px;
      }
    </style>
  </head>
  <body>
    <table id='assignments' class='data_table ' cellspacing='0' cellpadding='0'><caption>Table Title</caption><thead><tr><th class='description ' >Description</th><th class='score ' >Score</th><th class='points ' >Points</th><th class='karma ' >Karma</th></tr></thead><tbody class='yale'><tr class='group_header level_0'><th colspan='4'>Yale</th></tr><tr class='group_header level_1'><th colspan='4'>Math</th></tr><tr class='group_header level_2'><th colspan='4'>Homework</th></tr><tr class='row_0 ' ><td class='description text' >hw1</td><td class='score numeric' >98</td><td class='points numeric' >2</td><td class='karma numeric' >10</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 98.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 98.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max10.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 98.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Test</th></tr><tr class='row_0 ' ><td class='description text' >test 1</td><td class='score numeric' >89</td><td class='points numeric' >2</td><td class='karma numeric' >15</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 89.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 15.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 89.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max15.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 89.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 15.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_1'><th colspan='4'>Biology</th></tr><tr class='group_header level_2'><th colspan='4'>Quiz</th></tr><tr class='row_0 ' ><td class='description text' >quiz 1</td><td class='score numeric' >89</td><td class='points numeric' >2</td><td class='karma numeric' >7</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 89.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 7.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 89.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max7.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 89.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 7.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Test</th></tr><tr class='row_0 ' ><td class='description text' >test 2</td><td class='score numeric' >89</td><td class='points numeric' >2</td><td class='karma numeric' >10</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 89.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 89.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max10.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 89.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_1'><th colspan='4'>History</th></tr><tr class='group_header level_2'><th colspan='4'>Homework</th></tr><tr class='row_0 ' ><td class='description text' >hw2</td><td class='score numeric' >99</td><td class='points numeric' >2</td><td class='karma numeric' >13</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 99.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 13.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 99.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max13.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 99.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 13.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Test</th></tr><tr class='row_0 ' ><td class='description text' >test 1</td><td class='score numeric' >71</td><td class='points numeric' >2</td><td class='karma numeric' >20</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 71.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 20.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 71.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max20.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 71.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 20.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_1'><th colspan='4'>Law</th></tr><tr class='group_header level_2'><th colspan='4'>Homework</th></tr><tr class='row_0 ' ><td class='description text' >hw3</td><td class='score numeric' >93</td><td class='points numeric' >2</td><td class='karma numeric' >25</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 93.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 25.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 93.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max25.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 93.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 25.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Quiz</th></tr><tr class='row_0 ' ><td class='description text' >quiz 1</td><td class='score numeric' >91</td><td class='points numeric' >2</td><td class='karma numeric' >18</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 91.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 18.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 91.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max18.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 91.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 18.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='parent_subtotal index_0 yale'><td class='description text' ></td><td class='score numeric' >Score Avg 89.875</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 14.75</td></tr><tr class='parent_subtotal index_1 yale'><td class='description text' ></td><td class='score numeric' >Score Max 99.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max25.0</td></tr><tr class='parent_subtotal index_2 yale'><td class='description text' ></td><td class='score numeric' >Score Sum 719.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 118.0</td></tr><tr class='parent_subtotal index_3 yale'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr></tbody><tbody class='harvard'><tr class='group_header level_0'><th colspan='4'>Harvard</th></tr><tr class='group_header level_1'><th colspan='4'>History</th></tr><tr class='group_header level_2'><th colspan='4'>Homework</th></tr><tr class='row_0 ' ><td class='description text' >hw2</td><td class='score numeric' >90</td><td class='points numeric' >2</td><td class='karma numeric' >13</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 90.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 13.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 90.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max13.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 90.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 13.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Test</th></tr><tr class='row_0 ' ><td class='description text' >test 1</td><td class='score numeric' >75</td><td class='points numeric' >2</td><td class='karma numeric' >20</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 75.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 20.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 75.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max20.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 75.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 20.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_1'><th colspan='4'>Law</th></tr><tr class='group_header level_2'><th colspan='4'>Homework</th></tr><tr class='row_0 ' ><td class='description text' >hw3</td><td class='score numeric' >90</td><td class='points numeric' >2</td><td class='karma numeric' >25</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 90.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 25.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 90.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max25.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 90.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 25.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Quiz</th></tr><tr class='row_0 ' ><td class='description text' >quiz 1</td><td class='score numeric' >90</td><td class='points numeric' >2</td><td class='karma numeric' >18</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 90.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 18.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 90.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max18.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 90.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 18.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_1'><th colspan='4'>Math</th></tr><tr class='group_header level_2'><th colspan='4'>Homework</th></tr><tr class='row_0 ' ><td class='description text' >hw1</td><td class='score numeric' >62</td><td class='points numeric' >2</td><td class='karma numeric' >10</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 62.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 62.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max10.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 62.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Test</th></tr><tr class='row_0 ' ><td class='description text' >test 1</td><td class='score numeric' >53</td><td class='points numeric' >2</td><td class='karma numeric' >15</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 53.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 15.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 53.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max15.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 53.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 15.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_1'><th colspan='4'>Biology</th></tr><tr class='group_header level_2'><th colspan='4'>Quiz</th></tr><tr class='row_0 ' ><td class='description text' >quiz 1</td><td class='score numeric' >75</td><td class='points numeric' >2</td><td class='karma numeric' >7</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 75.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 7.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 75.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max7.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 75.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 7.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='group_header level_2'><th colspan='4'>Test</th></tr><tr class='row_0 ' ><td class='description text' >test 2</td><td class='score numeric' >32</td><td class='points numeric' >2</td><td class='karma numeric' >10</td></tr><tr class='subtotal index_0'><td class='description text' ></td><td class='score numeric' >Score Avg 32.0</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_1'><td class='description text' ></td><td class='score numeric' >Score Max 32.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max10.0</td></tr><tr class='subtotal index_2'><td class='description text' ></td><td class='score numeric' >Score Sum 32.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 10.0</td></tr><tr class='subtotal index_3'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr><tr class='parent_subtotal index_0 harvard'><td class='description text' ></td><td class='score numeric' >Score Avg 70.875</td><td class='points numeric' >Points Avg 2.0</td><td class='karma numeric' >Karma Avg 14.75</td></tr><tr class='parent_subtotal index_1 harvard'><td class='description text' ></td><td class='score numeric' >Score Max 90.0</td><td class='points numeric' >Points Max 2.0</td><td class='karma numeric' >Karma Max25.0</td></tr><tr class='parent_subtotal index_2 harvard'><td class='description text' ></td><td class='score numeric' >Score Sum 567.0</td><td class='points numeric' ></td><td class='karma numeric' >Karma Avg 118.0</td></tr><tr class='parent_subtotal index_3 harvard'><td class='description text' ></td><td class='score numeric' ></td><td class='points numeric' >Points custom</td><td class='karma numeric' ></td></tr></tbody><tfoot><tr class='total index_0'><td class='description text' ></td><td class='score numeric' >Total score max: 99.0</td><td class='points numeric' >Total score max: 2.0</td><td class='karma numeric' >Total score max: 25.0</td></tr><tr class='total index_1'><td class='description text' ></td><td class='score numeric' >Total score avg: 80.375</td><td class='points numeric' ></td><td class='karma numeric' ></td></tr></tfoot></table>
  </body>
</html>