[groovy-user] html markupbuilder: generate style, id, and class?

726 views
Skip to first unread message

Ray Tayek

unread,
Sep 30, 2010, 2:49:33 AM9/30/10
to us...@groovy.codehaus.org
hi, how do i generate style, id or class info in a paragraph or header.

this does not work: p(style:"color:blue;margin-left:20px") { "This is
a paragraph." }


thanks

---
co-chair http://ocjug.org/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Guillaume Laforge

unread,
Sep 30, 2010, 4:11:54 AM9/30/10
to us...@groovy.codehaus.org
Hi,

import groovy.xml.*
def mkp = new MarkupBuilder()
mkp.p(style:"color:blue;margin-left:20px", "This is a paragraph.")

Guillaume

--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

Ray Tayek

unread,
Sep 30, 2010, 6:10:30 AM9/30/10
to us...@groovy.codehaus.org
At 01:11 AM 9/30/2010, you wrote:
>... mkp.p(style:"color:blue;margin-left:20px", "This is a paragraph.")

works like a charm!

thanks


>On Thu, Sep 30, 2010 at 08:49, Ray Tayek <rta...@ca.rr.com> wrote:
> > hi, how do i generate style, id or class info in a paragraph or header.
> >
> > this does not work: p(style:"color:blue;margin-left:20px") { "This is a

> > paragraph." } ...

Reply all
Reply to author
Forward
0 new messages