CSV to HTML translation: Difference between revisions
Content added Content deleted
(→{{header|Tcl}}: Extra credit version) |
|||
Line 272: | Line 272: | ||
puts [subst { |
puts [subst { |
||
[table { |
[table { |
||
[tr [html::quoteFormValue [rows get]] {bgcolor=yellow}] |
[tr [html::quoteFormValue [rows get]] {bgcolor="yellow"}] |
||
[html::while {[rows size]} { |
[html::while {[rows size]} { |
||
[tr [html::quoteFormValue [rows get]]] |
[tr [html::quoteFormValue [rows get]]] |
||
Line 278: | Line 278: | ||
}] |
}] |
||
}]</lang> |
}]</lang> |
||
Output: |
|||
<lang html><table border="1" summary="csv2html program output"> |
|||
<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> |
|||
<tr bgcolor="orange"><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> |
|||
<tr bgcolor="orange"><td>The multitude</td><td>Who are you?</td></tr> |
|||
<tr bgcolor="orange"><td>Brians mother</td><td>I'm his mother; that's who!</td></tr> |
|||
<tr bgcolor="orange"><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr> |
|||
</table></lang> |