       [:tbody
         [:tr
           [:th.text-center {:colspan 2} "Headers"]]
-        (table-rows (.-headers result))]]])
+        (table-rows (js->clj (.-headers result)))]]])
 
 (defhtml result-table-header
   "HTML for a table header with timestamp and status."


(declare row-for) ; HTML snippet coming later in the namespace

(defn- table-rows [entries]
  (let [parsed-entries (js->clj entries)]
    (reverse (reduce #(conj %1 (row-for %2 (get parsed-entries %2))) () (keys parsed-entries)))))

(defn- html-escape 
  "Make a string possibly containing HTML display literally rather than as intepreted HTML."

    [:td key]
    [:td val]])

(defn- body-table-string-content [body]
  [:tr
    [:td.text-left [:pre [:code
      (html-escape body)]]]])

(defn- body-table-content [result]
  (let [body (aget result "body")
        cljs-body (js->clj body)]
    (if (map? cljs-body)
      (table-rows cljs-body)
      (body-table-string-content body))))

(defhtml body-table
