CSV to HTML translation: Difference between revisions
Content deleted Content added
→[[CSV to HTML translation#ALGOL 68]]: rename varibles. |
m changed ALL <pre> and <lang html*> to <lang html5> |
||
Line 65:
table.tmplt:
<lang
@@TABLE@@
<tr>
Line 75:
Output:
<lang
<tr>
<td>Character</td>
Line 174:
lmth</lang>
Output:
<lang html5><HTML>
<HEAD>
<TITLE>CSV to HTML translation - Extra Credit</TITLE>
Line 193 ⟶ 192:
</TABLE>
</BODY>
</HTML></lang>
=={{header|C}}==
This produces a full bare html (tidy gives 1 warning) with styles embedded but not
Line 291 ⟶ 288:
}</lang>
Output:
<
=={{header|C++}}==
Line 327 ⟶ 324:
}</lang>
Output:
<lang
<TABLE>
<TR><TD>Character</TD><TD>Speech</TD></TR>
Line 383 ⟶ 380:
Output:
<
=={{header|Delphi}}==
Line 593 ⟶ 589:
'''Basic output:'''
<lang
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Line 626 ⟶ 622:
'''Extra credit output:'''
<lang
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Line 736 ⟶ 732:
}</lang>
Standard output in table.html:
<lang
<tr><td>Character</td><td>Speech</td></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 747 ⟶ 742:
</lang>
Output with -h: (Notice <th> tag on first row. Otherwise output is identical.)
<lang
<tr><th>Character</th><th>Speech</th></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 821 ⟶ 815:
'''Basic output:'''
<div style="height:30ex;overflow:scroll;"><lang
<head>
<title>Basic</title>
Line 843 ⟶ 837:
'''Extra Credit output:'''
<div style="height:30ex;overflow:scroll;"><lang
<head>
<title>Extra Credit</title>
Line 905 ⟶ 899:
'''Basic output:'''
<div style="height:30ex;overflow:scroll;"><lang
<head>
<title>Basic</title>
Line 946 ⟶ 940:
'''Extra Credit output:'''
<div style="height:30ex;overflow:scroll;"><lang
<head>
<title>Extra Credit</title>
Line 1,022 ⟶ 1,016:
;Output:
<div style="height:30ex;overflow:scroll;"><lang
<tr>
<td>Character</td>
Line 1,075 ⟶ 1,069:
Output:
<lang
<THEAD>
<TR><TD>Character</TD><TD>Speech</TD></TR>
Line 1,128 ⟶ 1,122:
1 makeHTMLtablefromCSV CSVstrng</lang>
HTML output:
<lang
<tr><th>Character</th><th>Speech</th></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 1,164 ⟶ 1,158:
end</lang>
<
<tr><td>Character</td><td>Speech</td></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 1,171 ⟶ 1,165:
<tr><td>Brians mother</td><td>I'm his mother; that's who!</td></tr>
<tr><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr>
</table></lang>
=={{header|MATLAB}}==
Line 1,254 ⟶ 1,247:
Ouput:
<lang
ans =
Line 1,364 ⟶ 1,357:
Sample html output:
<lang
<tr>
<td>Character</td> <td>Speech</td>
Line 1,486 ⟶ 1,479:
Output:
<lang
<thead>
<tr>
Line 1,539 ⟶ 1,532:
Output (with a command-line argument):
<lang
<tr><th>Character</th><th>Speech</th></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 1,559 ⟶ 1,552:
(prinl) ) ) )</lang>
Output:
<lang
<tr><td>Character</td><td>Speech</td></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 1,578 ⟶ 1,571:
(prinl) ) ) ) )</lang>
Output:
<lang
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
<tr><td>Brians mother</td><td><angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry></td></tr>
Line 1,592 ⟶ 1,585:
</lang>
Output:
<lang
<colgroup>
<col/>
Line 1,605 ⟶ 1,597:
<tr><td>Brians mother</td><td>I'm his mother; that's who! </td></tr>
<tr><td>The multitude</td><td>Behold his mother! Behold his mother! </td></tr>
</table></lang>
===Extra credit solution===
<lang Powershell>
Line 1,620 ⟶ 1,611:
</lang>
Output:
<lang
<!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">
Line 1,702 ⟶ 1,693:
</lang>
OutPut :
<lang
<TR>
<TD>Character</TD><TD>Speech</TD>
Line 1,816 ⟶ 1,807:
</lang>
Output :
<lang
<THEAD>
<TR>
Line 1,879 ⟶ 1,870:
'''Sample HTML output'''
<lang
<TBODY><TR><TD>Character</TD><TD>Speech</TD></TR></TBODY>
<TBODY><TR><TD>The multitude</TD><TD>The messiah! Show us the messiah!</TD></TR></TBODY>
Line 1,924 ⟶ 1,915:
The raw HTML would not render correctly through the wiki interface but shows a suitably coloured table with cell borders.
-->
<lang
<THEAD bgcolor="yellow"><TR><TD>Character</TD><TD>Speech</TD></TR></THEAD>
<TBODY bgcolor="orange"><TR><TD>The multitude</TD><TD>The messiah! Show us the messiah!</TD></TR></TBODY>
Line 1,956 ⟶ 1,947:
end
puts "</table>"</lang>Sample output:<lang
<tr><th>Character</th><th>Speech</th></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 2,041 ⟶ 2,032:
}]</lang>
Output:
<lang
<tr bgcolor="yellow"><td>Character</td><td>Speech</td></tr>
<tr bgcolor="orange"><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
Line 2,091 ⟶ 2,082:
</lang>
=== Output (source code) ===
<lang
<html>
<head>
|