There are 2 ways of doing this that I am familiar with
The first is to export the result as an XML file and then use an XSL transformation to output it to a html file. You then need to process the HTML file by grouping it into a single line and setting the result to a variable. You can then reference the variable in your mail output
The second option is similar but might be a little easier. Use Pentaho Report Designer to create a report that uses your table input query. Design it how you want. Then in PDI choose a PRD Output step and output the report as a html file. You then process the html in the same way
Attached is an example job (and internal transformations) that does the 2nd option. Just save them all in the same directory and change the paths to the report PRPT file and where you want to store the html.