Use PDF Exporter to print content of table

There is also the built-in Papa Parse library if you strictly want CSV.

Depending on your source format

Papa.unparse(source)
// OR
Papa.unparse(formatDataAsArray(source))

The previous post allows more control on the format that you want