Create an HTML table: Difference between revisions

m
Line 2,209:
putStrLn $ renderHtml $ makeTable ["", "X", "Y", "Z"] 3 g</lang>
 
Or using the Shakespeare templates from the Yesod web framework.
{{libheader|shakespeare}}
<lang haskell>{-# LANGUAGE QuasiQuotes #-}
Line 2,259:
main :: IO ()
main = renderHtml . renderTable . rowsOf 3 . take 9 <$> randomValues >>= putStrLn
where rowsOf _ [] = []
rowsOf n_ xs[] = take n xs : rowsOf n (drop n xs)[]
rowsOf n xs = take n xs : rowsOf n (drop n xs)
randomValues = randomRs (1, 9999) <$> getStdGen</lang>
 
=={{header|Icon}} and {{header|Unicon}}==
Anonymous user