April 29, 2015 at 3:43 am
i am using below code and i am facing some alignment issue on column level as last column is not match with header and data value .
Any sugessions pls.Please find attachment for reference.
========================================================
SET @tableHTML =
N'<H1>details</H1>' +
N'<table border="1">' +
N'<tr><th>createdate</th>' +
N'<th>dbname</th>' +
N'<th>username</th>' +
N'<th>db_owner</th>' +
N'<th>db_accessadmin</th>' +
N'<th>DB_securityadmin</th>' +
N'<th>db_ddladmin</th>' +
N'<th>DB_datareader</th>' +
N'<th>Db_datawriter</th>' +
N'<th>Db_denydatareader</th></tr>' +
N'<th>Db_denydatawriter</th></tr>' +
CAST ( ( SELECT "td/@align" = 'right', td = createdate, '',
"td/@align" = 'right', td = dbname, '',
"td/@align" = 'right', td = username, '',
"td/@align" = 'right', td = DB_owner, '',
"td/@align" = 'right', td = DB_accessadmin, '',
"td/@align" = 'right', td = DB_securityadmin, '',
"td/@align" = 'right', td = DB_ddladmin, '',
"td/@align" = 'right', td = DB_datareader, '',
"td/@align" = 'right', td = DB_datawriter, '',
"td/@align" = 'right', td = DB_denydatareader, '',
"td/@align" = 'right', td = DB_denydatawriter, ''
FROM #Tablename
FOR XML PATH('tr'), TYPE
) AS NVARCHAR(MAX) ) +
N'</table>' ;
====================================================================
April 29, 2015 at 4:15 am
Change
N'<th>Db_denydatareader</th></tr>' +
to
N'<th>Db_denydatareader</th>' +
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537April 29, 2015 at 4:16 am
You've got two table row end tags in your header row, remove the </tr> from <th>Db_denydatareader</th></tr>
April 29, 2015 at 6:18 am
Thank you!!!
Its working now.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply