CSV to HTML translation: Difference between revisions

m
→‎{{header|Groovy}}: reformatting to improve clarity
(→‎{{header|Groovy}}: extra (builder) solution plus browser images)
m (→‎{{header|Groovy}}: reformatting to improve clarity)
Line 158:
}</lang>
 
'''Test:'''
<lang groovy>def csv = '''Character,Speech
The multitude,The messiah! Show us the messiah!
Line 177:
println '-----------------------------------------'</lang>
 
'''Basic output:'''
<pre style="height:30ex;overflow:scroll;"><html>
<head>
Line 197:
</body>
</html></pre>
[[File:Groovy-csv-to-html-basic.jpg]] Appearance as rendered in Google Chrome.
 
'''Extra Credit output:'''
"Basic" HTML appearance as rendered in Google Chrome:<br/>
[[File:Groovy-csv-to-html-basic.jpg]]
 
Extra Credit output:
<pre style="height:30ex;overflow:scroll;"><html>
<head>
Line 225 ⟶ 223:
</body>
</html></pre>
[[File:Groovy-csv-to-html-extra.jpg]] Appearance as rendered in Google Chrome.
 
"Extra Credit" HTML appearance as rendered in Google Chrome:<br/>
[[File:Groovy-csv-to-html-extra.jpg]]
 
===Solution #2: MarkupBuilder===
Line 262 ⟶ 258:
}</lang>
 
'''Test:'''<br/>
The interface is the same for both solutions, so we just reuse the same test as before.
 
'''Basic output:'''
<pre style="height:30ex;overflow:scroll;"><html>
<head>
Line 304 ⟶ 300:
</html></pre>
 
The "Basic" HTML for this solution looks superficially different than that from the GString solution, but the appearance as rendered in Google Chrome is identical.
 
'''Extra Credit output:'''
<pre style="height:30ex;overflow:scroll;"><html>
<head>
Line 349 ⟶ 345:
</html></pre>
 
The "Extra Credit" HTML for this solution looks superficially different than that from the GString solution, but the appearance as rendered in Google Chrome is identical.
 
=={{header|Icon}} and {{header|Unicon}}==
Anonymous user