Home » U++ Library support » U++ Core » HtmlTable class example request
Re: HtmlTable class example request [message #46104 is a reply to message #46101] |
Tue, 08 March 2016 06:26   |
|
In my experience, only reasonable way to write html without way too much hardcoded stuff is to use templates. You could reuse templates from Skylark, it shouldn't be too complicated to use without the rest of the framework. You only might need to supply some configuration. The code would look something like this:Renderer rr;
ValueArray rows;
// add your data to rows
rr("ROWS", rows);
String htmlTable = rr.Render("table.witz");
And the table.witz template would look similar to this, with endless styling options:<table>
<tr><td>Column1</td><td>Column2</td></tr>
$for(i in RESULTS)
<tr><td>$i.COL1</td><td>$i.COL2</td></tr>
$/
</table>
Note: I haven't tested this, so there might be some mistakes 
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Sun Jul 06 03:18:25 CEST 2025
Total time taken to generate the page: 0.03333 seconds
|