RosettaCodeData/Task/CSV-to-HTML-translation/00DESCRIPTION

26 lines
1 KiB
Text
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
Consider a simplified CSV format where all rows are separated by a newline
and all columns are separated by commas.
2016-12-05 22:15:40 +01:00
2015-02-20 00:35:01 -05:00
No commas are allowed as field data, but the data may contain
other characters and character sequences that would
2016-12-05 22:15:40 +01:00
normally be   ''escaped''   when converted to HTML
2013-04-10 16:57:12 -07:00
2016-12-05 22:15:40 +01:00
;Task:
Create a function that takes a string representation of the CSV data
2015-02-20 00:35:01 -05:00
and returns a text string of an HTML table representing the CSV data.
2016-12-05 22:15:40 +01:00
2015-02-20 00:35:01 -05:00
Use the following data as the CSV text to convert, and show your output.
2016-12-05 22:15:40 +01:00
: Character,Speech
: The multitude,The messiah! Show us the messiah!
: Brians mother,<nowiki><angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry></nowiki>
: The multitude,Who are you?
: Brians mother,I'm his mother; that's who!
: The multitude,Behold his mother! Behold his mother!
2013-04-10 16:57:12 -07:00
2016-12-05 22:15:40 +01:00
;Extra credit:
''Optionally'' allow special formatting for the first row of the table as if it is the tables header row
2015-02-20 00:35:01 -05:00
(via <nowiki><thead></nowiki> preferably; CSS if you must).
2016-12-05 22:15:40 +01:00
<br><br>