mirror of
https://github.com/byteverse/colonnade.git
synced 2026-09-05 03:33:49 +02:00
stop wrapping sectioned table in tbody
This commit is contained in:
parent
88b2704951
commit
432ab8d193
@ -134,6 +134,8 @@ static tableAttrs mheadAttrs bodyAttrs trAttrs colonnade collection =
|
|||||||
E.headerMonadicGeneral_ colonnade (elFromCell "th")
|
E.headerMonadicGeneral_ colonnade (elFromCell "th")
|
||||||
body bodyAttrs trAttrs colonnade collection
|
body bodyAttrs trAttrs colonnade collection
|
||||||
|
|
||||||
|
-- | A table dividing into sections by @\<td\>@ elements that
|
||||||
|
-- take up entire rows.
|
||||||
sectioned ::
|
sectioned ::
|
||||||
(DomBuilder t m, PostBuild t m, Foldable f, Foldable h, Foldable g)
|
(DomBuilder t m, PostBuild t m, Foldable f, Foldable h, Foldable g)
|
||||||
=> M.Map T.Text T.Text -- ^ @\<table\>@ tag attributes
|
=> M.Map T.Text T.Text -- ^ @\<table\>@ tag attributes
|
||||||
@ -147,16 +149,15 @@ sectioned ::
|
|||||||
-> m ()
|
-> m ()
|
||||||
sectioned tableAttrs mheadAttrs bodyAttrs trAttrs dividerContent colonnade@(E.Colonnade v) collection = do
|
sectioned tableAttrs mheadAttrs bodyAttrs trAttrs dividerContent colonnade@(E.Colonnade v) collection = do
|
||||||
let vlen = V.length v
|
let vlen = V.length v
|
||||||
elAttr "tbody" bodyAttrs $ do
|
elAttr "table" tableAttrs $ do
|
||||||
elAttr "table" tableAttrs $ do
|
for_ mheadAttrs $ \(headAttrs,headTrAttrs) ->
|
||||||
for_ mheadAttrs $ \(headAttrs,headTrAttrs) ->
|
elAttr "thead" headAttrs . elAttr "tr" headTrAttrs $
|
||||||
elAttr "thead" headAttrs . elAttr "tr" headTrAttrs $
|
E.headerMonadicGeneral_ colonnade (elFromCell "th")
|
||||||
E.headerMonadicGeneral_ colonnade (elFromCell "th")
|
elAttr "tbody" bodyAttrs $ forM_ collection $ \(b,as) -> do
|
||||||
elAttr "tbody" bodyAttrs $ forM_ collection $ \(b,as) -> do
|
let Cell attrsB contentsB = dividerContent b
|
||||||
let Cell attrsB contentsB = dividerContent b
|
elAttr "tr" M.empty $ do
|
||||||
elAttr "tr" M.empty $ do
|
elDynAttr "td" (M.insert "colspan" (T.pack (show vlen)) <$> attrsB) contentsB
|
||||||
elDynAttr "td" (M.insert "colspan" (T.pack (show vlen)) <$> attrsB) contentsB
|
bodyRows trAttrs colonnade as
|
||||||
bodyRows trAttrs colonnade as
|
|
||||||
|
|
||||||
encodeCorniceHead ::
|
encodeCorniceHead ::
|
||||||
(DomBuilder t m, PostBuild t m, Monoid e)
|
(DomBuilder t m, PostBuild t m, Monoid e)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user