I'm building some HTML to be included in the body of an email and sent using sp_send_dbmail. I'd like to right-align some of the columns. Is there an easy way to do this (short of rewriting it using FOR XML EXPLICIT)?
declare @html varchar(max)
set @html = '<table cellpadding=0 cellspacing=0 border=0>'
set @html +=
cast(
(select
'Column1' as td, '',
'Column2' as td, '',
'Column3' as [td align=right] /* Would like to do something like this */
for xml path('tr')) as varchar(max)
)
set @html += '</table>'