From f07bb06e1b757bec754b26fd66f4e708bc135282 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Wed, 20 Sep 2017 10:33:58 -0400 Subject: [PATCH] add staticTableless --- reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs b/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs index 67b39b9..f08e879 100644 --- a/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs +++ b/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs @@ -18,6 +18,7 @@ module Reflex.Dom.Colonnade -- * Table Encoders , basic , static + , staticTableless , capped , cappedResizable , cappedResizableTableless @@ -169,6 +170,21 @@ static tableAttrs mheadAttrs bodyAttrs trAttrs colonnade collection = E.headerMonadicGeneral_ colonnade (elFromCell "th") body bodyAttrs trAttrs colonnade collection +staticTableless :: + (DomBuilder t m, PostBuild t m, Foldable f, Foldable h, Monoid e) + => Maybe (M.Map T.Text T.Text, M.Map T.Text T.Text) + -- ^ Attributes of @\@ and its @\@, pass 'Nothing' to omit @\@ + -> M.Map T.Text T.Text -- ^ @\@ tag attributes + -> (a -> M.Map T.Text T.Text) -- ^ @\@ tag attributes + -> Colonnade h a (Cell t m e) -- ^ Data encoding strategy + -> f a -- ^ Collection of data + -> m e +staticTableless mheadAttrs bodyAttrs trAttrs colonnade collection = do + for_ mheadAttrs $ \(headAttrs,headTrAttrs) -> + elAttr "thead" headAttrs . elAttr "tr" headTrAttrs $ + E.headerMonadicGeneral_ colonnade (elFromCell "th") + body bodyAttrs trAttrs colonnade collection + -- | A table dividing into sections by @\@ elements that -- take up entire rows. sectioned ::