[Haskell-cafe] Network.Html simpleTable fonts

Tom Murphy amindfv at gmail.com
Mon Jul 18 01:03:57 CEST 2011


Sorry, forgot the important part:

import Network.CGI
import Text.XHtml


main :: IO ()
main = runCGI $ handleErrors $ (output . renderHtml) ourTable


ourTable = body << ourStyle +++ simpleTable [cellpadding 30,
cellspacing 10, border 2, bordercolor gray] [bgcolor aqua, align
"right", align "bottom"] ourTable'

ourTable' = map (map lineToHtml) [["Jay", "Jay", "Jay"], ["Leno",
"-Z", "Dilla"]]

ourStyle = style (stringToHtml "body { font-size: 50px }") ! [thetype
"text/css"]

On 7/17/11, Tom Murphy <amindfv at gmail.com> wrote:
> Here's the description of simpleTable:
> http://hackage.haskell.org/packages/archive/xhtml/3000.2.0.1/doc/html/Text-XHtml-Table.html
> (note the attribute lists)
>
> and here's a working example, for a light at the end of the tunnel:
>
>
> import Network.CGI
> import Text.XHtml
>
> main :: IO ()
> main = runCGI $ handleErrors $ (output . renderHtml) ourTable
>
> ourTable = body << simpleTable [cellpadding 30, cellspacing 10, border
> 2, bordercolor gray] [bgcolor aqua, align "right", align "bottom"]
> ourTable'
>
> ourTable' = map (map lineToHtml) [["J\nJ\nJay &nbsp y", "Jay", "Jay"],
> ["Leno", "-Z", "Dilla"]]
>
>
> Tom
>
>
>
> On Jul 17, 2011 3:34 PM, "william murphy" <will.t.murphy at gmail.com> wrote:
>> How does one change the font and size of text in a cells in a
>> simpleTable?
>> As in, to change the height, one could state:
>>
>> x = simpleTable [] [height "5"] exampleTable
>>
>> Thanks,
>>
>> Will
>



More information about the Haskell-Cafe mailing list