place to put first links

Testing: input formatting

This website has a number of text formatting options.

One of them is CSV - comma separated values - which allows users to input a list of data separated by commas, and the script will format it into tables (columns and rows).

Unfortunately, I cannot find any documentation on how to fully exploit its functions, so am testing this here... I've ask the question at the Drupal forums.

to use - enclose the following list in CSV tags (remove the asterisks in the tags to make it work):

<br />
[*CSV]<br />
Driver,Info,Team<br />
M Schumacher,WDC,Ferrari<br />
R Barrichello,Bunny,Ferrarong<br />
J Button,Prat,BART<br />
[/*CSV]<br />

Should come out as this:
[CSV]
Driver,Info,Team
M Schumacher,WDC,Ferrari
R Barrichello,Bunny,Ferrarong
J Button,Prat,BART
[/CSV]

__________________________
http://www.thefazz.com/me

Comments

TheFazz:

TheFazz's picture

<br />
[*CSV sep=, sortby=0]<br />
Number,Driver,Info,Team<br />
1,M Schumacher,WDC,Ferrari<br />
2,R Barrichello,Bunny,Ferrarong<br />
3,J Button,Prat,BART<br />
[/*CSV]<br />

Should come out as this:
[CSV sortby=0 header_class=dark header=0]
Number,Driver,Info,Team
1,M Schumacher,WDC,Ferrari
2,R Barrichello,Bunny,Ferrarong
3,J Button,Prat,BART
[/CSV]

__________________________

http://www.thefazz.com/me


»

TheFazz:

TheFazz's picture

The guide that I extracted from the module file...

Tables in CSV format

Full options list:

  • noheader
  • sortby=<nn>
  • sep=n (default ",")
  • spacing=nn
  • padding=nn
  • spacing=nn
  • header_class=<class> (default "cell-highlight")
  • odd_row_class=<class> (default "light")
  • even_row_class=<class> (default "dark")
  • odd_col_class=<class> (default none)
  • even_col_class=<class> (defaut none
  • unquoted
  • quote=<quote_char> (default '"')

Class names must be lowercased.
Teach on examples.

Table #1 (defaults)


[*CSV]
"column1","column2","column3"
1,"text for line #1", $1.1
2,"text for line #2", $1
[/*CSV]

Should render as follows:
[CSV]
"column1","column2","column3"
1,"text for line #1", $1.1
2,"text for line #2", $1
[/CSV]

Table #2 (custom spacing and separator)


[*CSV spacing=0 noheader sep=! header_class=dark]
first!second!third
123!151 209 982!-15
321!998 000 150!-1.5
456!100 011 200!-.15
[/*CSV]

Should render as follows:
[CSV spacing=0 noheader sep=! header_class=dark]
first!second!third
123!151 209 982!-15
321!998 000 150!-1.5
456!100 011 200!-.15
[/CSV]

Table #3 (sorting)


[*CSV order=desc sortby=2 noheader unquoted]
1,100,2nd string
2,200,1st string
3,300,3d string
[/*CSV]

Should render as follows:
[CSV order=desc sortby=2 noheader unquoted]
1,100,2nd string
2,200,1st string
3,300,3d string
[/CSV]

__________________________

http://www.thefazz.com/me


»

TheFazz:

TheFazz's picture

more testing...

myTEST#1 (spacing)


[*CSV spacing=5]
first,second,third
123,151 209 982,-15
321,998 000 150,-1.5
456,100 011 200,-.15
[/*CSV]

Should render as follows:
[CSV spacing=5]
first,second,third
123,151 209 982,-15
321,998 000 150,-1.5
456,100 011 200,-.15
[/CSV]

myTEST#2 (header)


[*CSV spacing=1 header_class=cell-highlight]
first,second,third
123,151 209 982,-15
321,998 000 150,-1.5
456,100 011 200,-.15
[/*CSV]

Should render as follows:
[CSV spacing=1 header_class=cell-highlight]
first,second,third
123,151 209 982,-15
321,998 000 150,-1.5
456,100 011 200,-.15
[/CSV]

__________________________

http://www.thefazz.com/me


»