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++ MT-multithreading and servers » Htmls / HtamlTag class and table generation
Re: Htmls / HtamlTag class and table generation [message #34945 is a reply to message #34940] Mon, 19 December 2011 15:00 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
dolik.rce wrote on Sun, 18 December 2011 21:54


It seems messy, but when all the operation are performed in cycles and functions it is not that bad Smile The rule of thumb is that '+' adds tag on the same level and '/' places tag inside.

Best regards,
Honza


Hi Honza!

Thanks a lot, it is what I was looking for.
It is a bit messy but seems not so complicated and better looking that write "<TD>..." everywhere.
I vote to include the previous code snippet in the reference assembly. It's a pity to let it disappear in the forum.

Best wishes,
Luigi

#include <Core/Core.h>
#include <Web/Web.h>

using namespace Upp;

CONSOLE_APP_MAIN{
	Htmls html;
	html << HtmlTable().Width(200).Border(1) / (
		HtmlRow() / (
			HtmlTag("th") / "column 1"
			+ HtmlTag("th") / "column 2" 
		) + 
		HtmlRow() / (
			HtmlCell() / HtmlLink("http://ultimatepp.org") / "A1"
			+ HtmlCell() / "A2"
		) +
		HtmlRow() / (
			HtmlCell() / "B1"
			+ HtmlCell() / Htmls("<i>some</i> <b>html</b> blob")
		)
	);
	SaveFile("page.html", html);
}

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Need a suggestion about mouse processing inside threads
Next Topic: Deadlock - what LeaveGMutexAll does?
Goto Forum:
  


Current Time: Wed May 15 11:54:02 CEST 2024

Total time taken to generate the page: 0.02657 seconds