Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Wink

Best regards,
Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IntStr function returns an empty string
Next Topic: conversion from String to wchar_t
Goto Forum:
  


Current Time: Sun Jul 06 03:18:25 CEST 2025

Total time taken to generate the page: 0.03333 seconds