Skip to content

Commit

Permalink
enhance pivot table element to be well formed
Browse files Browse the repository at this point in the history
  • Loading branch information
astechdev committed Aug 5, 2015
1 parent 06e6236 commit e9b50d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions dist/pivot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pivot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ callWithJQuery ($) ->
#now actually build the output
result = document.createElement("table")
result.className = "pvtTable"
thead = document.createElement("thead");
tbody = document.createElement("tbody");

#helper function for setting row/col-span in pivotTableRenderer
spanSize = (arr, i, j) ->
Expand Down Expand Up @@ -509,7 +511,9 @@ callWithJQuery ($) ->
td.innerHTML = totalAggregator.format(val)
td.setAttribute("data-value", val)
tr.appendChild td
result.appendChild tr
tbody.appendChild tr
result.appendChild thead
result.appendChild tbody

#squirrel this away for later
result.setAttribute("data-numrows", rowKeys.length)
Expand Down

0 comments on commit e9b50d9

Please sign in to comment.