CSV to HTML translation: Difference between revisions

(→‎{{header|REXX}}: added the '''changestr''' bif. -- ~~~~)
Line 1,608:
PrintStream stdout = System.out;
stdout.printprintln("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
+stdout.println("<html "xmlns=\"http://www.w3.org/TR1999/xhtml1/DTD/xhtml1-strict.dtdxhtml\">");
+ stdout.println("<head><meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\"/>");
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
stdout.println("<title>Csv2Html</title>");
+ "<head><meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\"/>"
+ stdout.println("<title>Csv2Html</title><style type=\"text/css\">");
+ stdout.println("body{background-color:#FFF;color:#000;font-family:OpenSans,sans-serif;font-size:10px;}");
+ stdout.println("table{border:0.2em solid #2F6FAB;border-collapse:collapse;}");
+ stdout.println("th{border:0.15em solid #2F6FAB;padding:0.5em;background-color:#E9E9E9;}");
+ stdout.println("td{border:0.1em solid #2F6FAB;padding:0.5em;background-color:#F9F9F9;}</style>");
+ stdout.println("</head><body><h1>Csv2Html</h1>");
 
stdout.println("<table>");
Line 1,636:
</lang>
 
'''output simple.html'''
<lang html5><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
<head><meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
<title>Csv2Html</title>
<style type="text/css">
body{background-color:#FFF;color:#000;font-family:OpenSans,sans-serif;font-size:10px;}
table{border:0.2em solid #2F6FAB;border-collapse:collapse;}
th{border:0.15em solid #2F6FAB;padding:0.5em;background-color:#E9E9E9;}
td{border:0.1em solid #2F6FAB;padding:0.5em;background-color:#F9F9F9;}</style>
</head><body><h1>Csv2Html</h1>
<table>
<tr><td>Character</td><td>Speech</td></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
<tr><td>Brians mother</td><td>&lt;angry&gt;Now you listen here! He&apos;s not the messiah; he&apos;s a very naughty boy! Now go away!&lt;/angry&gt;</td></tr>
<tr><td>The multitude</td><td>Who are you?</td></tr>
<tr><td>Brians mother</td><td>I&apos;m his mother; that&apos;s who!</td></tr>
<tr><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr>
</table></body></html></lang>
 
'''output extended.html'''
<lang html5><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
<title>Csv2Html</title>
<style type="text/css">
body{background-color:#FFF;color:#000;font-family:OpenSans,sans-serif;font-size:10px;}
table{border:0.2em solid #2F6FAB;border-collapse:collapse;}
th{border:0.15em solid #2F6FAB;padding:0.5em;background-color:#E9E9E9;}
td{border:0.1em solid #2F6FAB;padding:0.5em;background-color:#F9F9F9;}</style>
</head><body><h1>Csv2Html</h1>
<table>
<tr><th>Character</th><th>Speech</th></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
<tr><td>Brians mother</td><td>&lt;angry&gt;Now you listen here! He&apos;s not the messiah; he&apos;s a very naughty boy! Now go away!&lt;/angry&gt;</td></tr>
<tr><td>The multitude</td><td>Who are you?</td></tr>
<tr><td>Brians mother</td><td>I&apos;m his mother; that&apos;s who!</td></tr>
<tr><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr>
</table></body></html></lang>
 
=={{header|JavaScript}}==