如何在HTML_存储过程中设置正确的对齐方式 [英] how to set right alignment in HTML_ stored procedure
本文介绍了如何在HTML_存储过程中设置正确的对齐方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi, i created stored stored procedure to send mail . so, i desinged HTML format inside the stored procedure.
so, How to assign right alignment in below(price, qty) HTML "SQL Query".?
N'<TABLE BODY BGCOLOR = #ffffff ALIGN = CENTER HEIGHT = 2% WIDTH = 95% CELLPADDING = 2 CELLSPACING = 2 BGCOLOR=#2d58a6 BORDER = 0 > ' +
N'<TR ALIGN = CENTER BGCOLOR = #2d58a6 HEIGHT = 10% >' +
N'<TD style="font-family:Arial, Helvetica, sans-serif; color:#ffffff; font-size:14px; text-align:right; line-height:25px;">PRICE</TD>' +
N'<TD style="font-family:Arial, Helvetica, sans-serif; color:#ffffff; font-size:14px; text-align:right; line-height:25px;">QTY</TD>' +
N'</TR>'+
CAST ( ( SELECT
TD=convert(char(10), round(tbname.PRICE,2)),'',
TD=SODETAIL.QTY, '',
TD=convert(char(10),round(Tbname.PRICE * tbname.QTY,2)),''
WHERE Atbname.orderno = btbname.orderno
FOR XML PATH('TR'), ELEMENTS
) AS NVARCHAR(MAX) ) +
N'</TABLE>'+
Note: the text (ie, Price, Qty can be set right alignment) but how to align the value of price, qty in right side in the select query.
when i execute the stored procedure ,
the output came like below:
PRICE Qty
75.00 6
so, i need output format below:
PRICE QTY
75.00 6
167.00 78
If you know , please correct this.Thank you in Advance.
推荐答案
>
Hi,
<html>
<body dir="rtl">
This is a Test for Right to Left
</body>
</html>
body dir =rtl
这意味着来自RTL的方向 - > ;从右到左
这可以用于HTML或任何需要的标签。
示例:
body dir="rtl"
Which means direction of the conents from RTL -> Right to Left
This can be given to HTML or any Tag where it is required.
Example:
<html dir="rtl">
这篇关于如何在HTML_存储过程中设置正确的对齐方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文