Has anyone got any sample code for generating a professional looking table that will be emailed?I've created something myself and, as a first attempt, I'm quite pleased with it but I'm sure someone has something a lot more pleasing to the eye.FWIW, my table code follows and for those of you who can interpret it, you can see it's functional but there are no bells and whistlesSET @tableHTML = N'<style type = ''text/css''>' + N'table { cellpadding:16px; border:1px double #e3e3e3; font:11pt; }' + N'table td, table th { padding: 5px; color: #333; }' + N'table caption { border:1px double #e3e3e3; font-variant:small-caps; font-weight:bold; }' + N'table th { font-variant:small-caps; font-weight:bold; border-bottom: 1px solid #e3e3e3; border-top: 1px solid #e3e3e3; }' + N'table td { border-bottom: 1px solid #e3e3e3; border-top: 1px solid #e3e3e3; }' + N'</style>' + N'<table>' + N'<caption>Files not updated as part of the overnight load</caption>' + N'<tr><th>File No</th><th>File Name</th><th>Last Modified Date</th><th>Last Modified Time</th></tr>' +CAST ((SELECT td = FileNo, '', td = FileName, '', td = DateMod, '', td = TimeMod, ''FROM logfile ORDER BY DateMod, TimeModFOR XML PATH('tr'), TYPE) AS NVARCHAR(MAX)) + N'</table>'
Thanks for any input!