From 432ab8d193f9e735e346be783907c70a31a10de2 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 8 May 2017 21:13:15 -0400 Subject: [PATCH] stop wrapping sectioned table in tbody --- .../src/Reflex/Dom/Colonnade.hs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs b/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs index 0256ef2..4fd1512 100644 --- a/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs +++ b/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs @@ -134,6 +134,8 @@ static tableAttrs mheadAttrs bodyAttrs trAttrs colonnade collection = E.headerMonadicGeneral_ colonnade (elFromCell "th") body bodyAttrs trAttrs colonnade collection +-- | A table dividing into sections by @\@ elements that +-- take up entire rows. sectioned :: (DomBuilder t m, PostBuild t m, Foldable f, Foldable h, Foldable g) => M.Map T.Text T.Text -- ^ @\@ tag attributes @@ -147,16 +149,15 @@ sectioned :: -> m () sectioned tableAttrs mheadAttrs bodyAttrs trAttrs dividerContent colonnade@(E.Colonnade v) collection = do let vlen = V.length v - elAttr "tbody" bodyAttrs $ do - elAttr "table" tableAttrs $ do - for_ mheadAttrs $ \(headAttrs,headTrAttrs) -> - elAttr "thead" headAttrs . elAttr "tr" headTrAttrs $ - E.headerMonadicGeneral_ colonnade (elFromCell "th") - elAttr "tbody" bodyAttrs $ forM_ collection $ \(b,as) -> do - let Cell attrsB contentsB = dividerContent b - elAttr "tr" M.empty $ do - elDynAttr "td" (M.insert "colspan" (T.pack (show vlen)) <$> attrsB) contentsB - bodyRows trAttrs colonnade as + elAttr "table" tableAttrs $ do + for_ mheadAttrs $ \(headAttrs,headTrAttrs) -> + elAttr "thead" headAttrs . elAttr "tr" headTrAttrs $ + E.headerMonadicGeneral_ colonnade (elFromCell "th") + elAttr "tbody" bodyAttrs $ forM_ collection $ \(b,as) -> do + let Cell attrsB contentsB = dividerContent b + elAttr "tr" M.empty $ do + elDynAttr "td" (M.insert "colspan" (T.pack (show vlen)) <$> attrsB) contentsB + bodyRows trAttrs colonnade as encodeCorniceHead :: (DomBuilder t m, PostBuild t m, Monoid e)