Problems with displaying an html table within an Email Template

I haven’t tried fetch the data from DB and passing to email template. My is guess the parameter that you’re passing is taking as a string. Can you try below code?

#include($htmlTable)

For reference