What do you *actually* want? You ask for three separate
things:
1) Excel
2) CSV
3) HTML
If the Excel requirement is just that you want values in
cells, simply
create an HTML table, and then return it to the browser as an
application/xls with <cfcontent>. If it's more complex
than that, there's
been plenty of other threads on these forums discussing how
to do it. Use
"search".
Note that a CSV file has nothing - per-se - to do with Excel,
other than
the fact Excel can open them.
http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
If you want an HTML table, then... your sample code simply
needs <table>
tags around it.
I think you're going to have to think through what your
actual requirement
is, and express it to us slightly more clearly.
--
Adam