I have a BOOLEAN of showhurdle.
If True then show an extra td.
if False then do not show and extra td.
I have tried…
colspan 0
how can i exclude a td?
or
Else Nothing…
someBodyTds : Date -> List (Html msg)
someBodyTds date = let
hurdlePoint =
if showHurdle then
td
[]
-- TODO: This should hold the actual hurdle points.
[ text "Hurdle 1 " ]
else
--DONT show this TD AT ALL
td [] [ text "I should not exist" ]
in
[ td
[]
[ text "td ONE" ]
, td
[]
[ text Date.toIsoString date ]
, hurdlePoint
, td
[]
[ text " td THREE or FOUR depending... "]
]
replacing with text "" still gives a td its just empty.
it then offsets the whole table. as the the table header has a colspan of 3 or 4.
So that does not work. Since I need the WHOLE td to either exist or not. not the text data.
i know I could do…
someBodyTds : Date -> List (Html msg)
someBodyTds date = let
hurdlePoint =
if showHurdle then
[ td
[]
[ text "td ONE" ]
, td
[]
[ text Date.toIsoString date ]
, td [] [ text "Hurdle 1" ]
, td
[]
[ text " td THREE or FOUR depending... "]
]
else
[ td
[]
[ text "td ONE" ]
, td
[]
[ text Date.toIsoString date ]
, td
[]
[ text " td THREE or FOUR depending... "]
]
in
hurdlePoint
I meant something like this, which shouldn’t print an extra td if showHurdle is false.
someBodyTds : Date -> List (Html msg)
someBodyTds date = let
hurdlePoint =
if showHurdle then
td
[]
-- TODO: This should hold the actual hurdle points.
[ text "Hurdle 1 " ]
else
--DONT show this TD AT ALL
text ""
in
[ td
[]
[ text "td ONE" ]
, td
[]
[ text Date.toIsoString date ]
, hurdlePoint
, td
[]
[ text " td THREE or FOUR depending... "]
]