 
 (defn- period-heading
   [budget index]
-  [:th (budget-period-start-date budget index)])
+  [:th.text-right (budget-period-start-date budget index)])
 
 (defn- budget-header-row
   [budget]

      [:table.table.table-striped
       (html
       (budget-header-row budget)
       (map #(budget-data-row budget %) (:items budget)))]
      [:a.btn.btn-primary {:href (format "/budgets/%s/items/new" (:id budget))} "Add"]
      "&nbsp;"
      [:a.btn.btn-default {:href (format "/entities/%s/budgets" (:entity-id budget))} "Back"]]])))

   (html
     [:th "Account"]
     (map #(period-heading budget %) (range 0 (:period-count budget)))
     [:th.text-right "Total"])])

(defn- budget-period-cell
  [period]
  [:td.text-right (format-number (:amount period))])

(defn- budget-item-row
  [budget item]
  [:tr
   (html
     [:td (:account-id item)]
     (map budget-period-cell (:periods item))
     [:td (format-number (reduce + 0 (map :amount (:periods item))))])])

(defn show
  "Renders the budet details"
