Hey Antonio,

I would put a style class on the table or on the WTemplate widget and
put styling in a CSS stylesheet.
But your approach (putting CSS declarations inline) should work really.

Regards,
koen

2013/10/14 Antonio Mancina <[email protected]>:
> Hi,
>
> I'm trying to get used to the WTemplate approach for items positioning
> and layout creation.
>
> I wrote a very simple resource xml file like this:
>
>
> ====== File resources.xml ==================
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <messages>
>
> <message id="sample-layout">
> <table>
> <tr>
> <td>Item 1</td><td>${item2}</td>
> </tr>
> <tr>
> <td>Item 3</td><td>${item4}</td>
> </tr>
> </table>
> </message>
>
> </messages>
> ============================================
>
> In my sample Wt application, I have this line within the main
> application module:
>
>   messageResourceBundle().use(WApplication::appRoot() + "resources");
>
> and my custom container widget containes the following code:
>
> ================== File CustomContainerWidget.cpp =============
> // CTor body
>
>   Wt::WTemplate *t =
>     new Wt::WTemplate(Wt::WString::tr("sample-layout"));
>
>   t->bindWidget("item2", new Wt::WText("Item 2"));
>   t->bindWidget("item4", new Wt::WText("Item 4"));
>
>   addWidget(t);
> ===============================================================
>
> Elements are correctly placed within the page. I'd like to add some
> attributes to the table rendering, like a border or some other things,
> but no matter how I modify the <table> tag (either with direct tags,
> or with a style="<css code>" way), I seem not to be able to get this
> result.
>
> How would you add a border around elements with this technique?
>
> Thanks a lot,
> Antonio
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to