              (map-indexed
                (fn [col-index col]
                  (let [render-content (or (:content-renderer col) (fn [i data] data))]
-                   (render-body-cell
-                     props
-                     (nth (:column-widths props) col-index)
-                     (render-content row-index (nth row col-index)))))
+                   (render-cell
+                     {:width (nth (:column-widths props) col-index)
+                      :content (render-content row-index (nth row col-index))
+                      :cell-padding-left (or (:cell-padding-left props) 0)
+                      :content-container-style (merge
+                                                 {:padding (str "0.6em 0 0.6em " (or (:cell-padding-left props) 0))}
+                                                 (:cell-content-style props))})))
                (:columns props))
              (common/clear-both)]))
         (:rows @state))])})

     [:div {:style {:position "absolute" :top "50%" :right 0 :width 16 :transform "translateY(-50%)"}}
      (if (= :asc sortOrder) "↑" "↓")])
   [:div {:style (merge {:whiteSpace "nowrap" :overflow "hidden" :textOverflow "ellipsis"
                         :width (str "calc(" (- width (if sortOrder 16 0)) "px - " cell-padding-left ")")}
                   content-container-style)}
    content]])


(defn- render-header-cell [props index width content onResizeMouseDown onSortClick sortOrder]
  (render-cell
    width
    content
    (when onResizeMouseDown {:borderRight "1px solid #777777" :marginRight -1})
    (or (:cell-padding-left props) 0)
    (merge
      {:padding (str "0.8em 0 0.8em " (or (:cell-padding-left props) 0))}
      (:header-style props))
    onResizeMouseDown
    onSortClick
    sortOrder))


(defn- render-body-cell [props width content]
  (render-cell
    width
    content
    nil
    (or (:cell-padding-left props) 0)
    (merge
      {:padding (str "0.6em 0 0.6em " (or (:cell-padding-left props) 0))}
      (:cell-content-style props))
    nil
    nil
    nil))


(react/defc Body

     ((:onChange props)))})


(defn- render-cell [{:keys [width onResizeMouseDown onSortClick sortOrder] :as props}]
  [:div {:style (merge {:float "left" :position "relative" :width width :minWidth 10}
                  (:cell-style props))}
   (when (:onResizeMouseDown props)
     [:div {:style {:position "absolute" :width 20 :top 0 :bottom 0 :left (- width 10) :zIndex 1
                    :cursor "col-resize"}
            :onMouseDown onResizeMouseDown}])
