Text.Xhtml.Table problems, with a very simple table
Hi All, I'm trying to create a table like this: ---------- | a1 | | |----| b | | a2 | | ---------- My code is this: triTable a1 a2 b = table << ((a1 </> a2) <-> (b)) But it's mashing elements together. What am I doing wrong?? Thanks for your time, Tom
I think you have it backwards. <-> is above and </> is beside. Yeah, I would have messed up too, bad choice by the library writer. triTable a1 a2 b = table << a1 `above` a2 `beside` b seems to work for me, but you can add parenthesis around the a's to make it more clear. On Mon, Jun 20, 2011 at 2:41 PM, Tom Murphy <amindfv@gmail.com> wrote:
Hi All,
I'm trying to create a table like this:
---------- | a1 | | |----| b | | a2 | | ----------
My code is this:
triTable a1 a2 b = table << ((a1 </> a2) <-> (b))
But it's mashing elements together. What am I doing wrong??
Thanks for your time, Tom
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
On 6/20/11, David McBride <dmcbride@neondsl.com> wrote:
I think you have it backwards. <-> is above and </> is beside.
No, I think </> is above: (http://hackage.haskell.org/packages/archive/xhtml/3000.2.0.1/doc/html/src/Te...)
triTable a1 a2 b = table << a1 `above` a2 `beside` b
seems to work for me, but you can add parenthesis around the a's to make it more clear.
For some reason, it's not working for me. The input: triTable (toHtml $ "1") (toHtml $ "2") (toHtml $ "3") results in: "<table ><tr >13</tr ><tr >2</tr ></table >" even when I just set it up as a "let" in GHCi. Thanks, Tom
If I'm reading your diagram correctly (and I'm not sure I am), removing the parentheses from your triTable definition seems to work for me. Rendered, it looks liks 1 2 3 I'm not sure if your intention is that the 3 should be centered, but if so, obviously that doesn't work. Prelude Text.Html> let triTable a1 a2 b = table << a1 </> a2 <-> b Prelude Text.Html> triTable (toHtml $ "1") (toHtml $ "2") (toHtml $ "3") <TR> <TABLE COLSPAN = "2"> 1 </TABLE> </TR> <TR> 2 3 </TR> Is that what you're going for? On Jun 20, 2011, at 3:26 PM, Tom Murphy wrote:
On 6/20/11, David McBride <dmcbride@neondsl.com> wrote:
I think you have it backwards. <-> is above and </> is beside.
No, I think </> is above: (http://hackage.haskell.org/packages/archive/xhtml/3000.2.0.1/doc/html/src/Te...)
triTable a1 a2 b = table << a1 `above` a2 `beside` b
seems to work for me, but you can add parenthesis around the a's to make it more clear.
For some reason, it's not working for me. The input: triTable (toHtml $ "1") (toHtml $ "2") (toHtml $ "3")
results in: "<table
<tr 13</tr <tr 2</tr </table " even when I just set it up as a "let" in GHCi.
Thanks, Tom
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
Oh yeah I forgot to mention, there are no tds being generated. I manually added them to my code and forgot. Change your code to this: triTable a1 a2 b = table << td a1 `above` td a2 `beside` td b I assume it doesn't add them automatically because there are attributes you might want to add to your tds. On Mon, Jun 20, 2011 at 3:26 PM, Tom Murphy <amindfv@gmail.com> wrote:
On 6/20/11, David McBride <dmcbride@neondsl.com> wrote:
I think you have it backwards. <-> is above and </> is beside.
No, I think </> is above: (http://hackage.haskell.org/packages/archive/xhtml/3000.2.0.1/doc/html/src/Te...)
triTable a1 a2 b = table << a1 `above` a2 `beside` b
seems to work for me, but you can add parenthesis around the a's to make it more clear.
For some reason, it's not working for me. The input: triTable (toHtml $ "1") (toHtml $ "2") (toHtml $ "3")
results in: "<table ><tr >13</tr ><tr >2</tr ></table >" even when I just set it up as a "let" in GHCi.
Thanks, Tom
On 6/20/11, David McBride <dmcbride@neondsl.com> wrote:
Oh yeah I forgot to mention, there are no tds being generated. I manually added them to my code and forgot. Change your code to this:
triTable a1 a2 b = table << td a1 `above` td a2 `beside` td b
I assume it doesn't add them automatically because there are attributes you might want to add to your tds.
THIS is what I was missing. Works beautifully now. Thank you! Tom
participants (3)
-
David McBride -
Jack Henahan -
Tom Murphy