To have Tab

Hi,
when appending lines to the email body, I want to have tab right after ":" below. How?
‧過期件運單處理: 盡快...
‧已取件的運單: 盡快...

Open in new window

LVL 12
HuaMin ChenProblem resolverAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
try press {tab} key to do that...

tab
alternatively you can use a table to align your email body if it's in HTML mode.
Rafiq J.Net DeveloperCommented:
...] line breaks in the body of a message MUST be encoded with "%0D%0A".
Implementations MAY add a final line break to the body of a message even if there is no trailing "%0D%0A" in the body [...]





code;

<mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index>

output:

send current-issue
send index
Rafiq J.Net DeveloperCommented:
try this html code

'<html><body>Hi, welcome to &nbsp;&nbsp;&nbsp;Our World</body>  </html>

output

Hi, welcome to    Our World


Like us if really this help u
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

KimputerCommented:
In your code:

var vartext = "過期件運單處理:\t盡快...";

Open in new window


But it depends on how you pass it on to the next level how it's displayed. How it the email generated ? Using Outlook Interop code?
HuaMin ChenProblem resolverAuthor Commented:
Thanks all.

Ryan,
I am writing these below
            fmsg += "<b>‧過期件運單處理:</b>盡快...</br></br>";
            fmsg += "<b>‧已取件的運單:</b>盡快...</br></br>";

Open in new window


how to put Tab in above, to the line?
KimputerCommented:
Seems it's full HTML, so Rafiq J comment is the correct one:

fmsg += "<b>‧過期件運單處理:&nbsp;&nbsp;&nbsp;&nbsp;</b>盡快...</br></br>";
            fmsg += "<b>‧已取件的運單:&nbsp;&nbsp;&nbsp;&nbsp;</b>盡快...</br></br>";

Open in new window

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
quick try:

fmsg += "<b>‧過期件運單處理     :</b>盡快...</br></br>";
fmsg += "<b>‧已取件的運單       :</b>盡快...</br></br>";

Open in new window


(after the chinese chars, press {tab} to put the ":" away)

However, it seems that you will generate HTML output in your email body, this will not work well.

As from my suggestion, I will use a table instead, like:

fmsg +="<table>" +
"<tr><td>‧過期件運單處理</td><td>:</td><td>盡快...</td></tr>" +
"<tr><td>‧已取件的運單</td><td>:</td><td>盡快...</td></tr>" +
"</table>";

Open in new window

HuaMin ChenProblem resolverAuthor Commented:
Ryan,
I've just tried your way but I do not want to use a table, as there is lines to that, and I only want to have a Tab within the two lines.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
then by using &nbsp; may closely give u the look u want.
Daniel Van Der WerkenIndependent ConsultantCommented:
Looks like a classic case of CSS use would be better here.

I used Notepad++ and all the Chinese went bye bye, so here's a suggested way of styling this output that might be more appropriate. Let the browser do the work:

<html>
<body>
<b><span style="width:250; position: relative; float:left;margin:0px; overflow:hidden;">yada yada yada</span></b>
<span style="width:200; position:relative; float:left;">:&nbsp;thingy...</span><br />
<b><span style="width:250; position: relative; float:left;margin:0px; overflow:hidden;">humdidy humdidy hum</span></b>
<span style="width:200; position:relative; float:left;">:&nbsp;robots...</span>
 </body>
 </html>

Open in new window


You would, of course, implement your C# code to generate this but the idea is to let the browser set the styling instead of hard-styling with spaces, etc. I did have to add on hard-coded space though.

Just a suggestion as another way to do this. Play with CSS I think and you'll get better results overall.
Here's my output
HuaMin ChenProblem resolverAuthor Commented:
17Many thanks. I have these
            fmsg += "<b><span style='width:230; position: relative; float:left;margin:0px; overflow:hidden;'>‧過期件運單處理:</span></b><span style='width:280; position:relative; float:left;'>&nbsp;盡快取回快件, 然後在系統維護有關單號狀態 (錄入“回收未領取包裹”), 並上報客服或致電客人安排改派‧</span><br />";
            fmsg += "<b><span style='width:230; position: relative; float:left;margin:0px; overflow:hidden;'>‧已取件的運單:</span></b><span style='width:280; position:relative; float:left;'>&nbsp;盡快收回回單, 然後在系統維護有關單號狀態 (錄入“已簽回單”) ‧</span>";

but I still do not get extra space right after ":" in below.
HuaMin ChenProblem resolverAuthor Commented:
I mean I still do not get extra space right after ":" referring to the above screenshot.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
you need to multiply the &nbsp; to get the space effect...

like change:
<span style='width:280; position:relative; float:left;'>&nbsp;盡快收回回單, 然後在系統維護有關單號狀態 (錄入“已簽回單”) ‧</span>"

Open in new window

to:
<span style='width:280; position:relative; float:left;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;盡快收回回單, 然後在系統維護有關單號狀態 (錄入“已簽回單”) ‧</span>"

Open in new window

so try adjust the "space" accordingly.
HuaMin ChenProblem resolverAuthor Commented:
Many thanks. Can I have one specific font to the relevant text?
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
you can apply css or a simple <font> tag in HTML to specific a font you want for a specific text,

CSS Font
http://www.w3schools.com/css/css_font.asp

HTML <font> Tag
http://www.w3schools.com/tags/tag_font.asp
HuaMin ChenProblem resolverAuthor Commented:
Many thanks.
I have these

            fmsg += "<b><span style='width:230; position: relative; float:left;margin:0px; overflow:hidden;'><font face='Courier New'>‧過期件運單處理:</font></span></b><span style='width:280; position:relative; float:left;'><font face='Courier New'>&nbsp;&nbsp盡快取回快件, 然後在系統維護有關單號狀態 (錄入“回收未領取包裹”), 並上報客服或致電客人安排改派‧</font></span><br />";
            fmsg += "<b><span style='width:230; position: relative; float:left;margin:0px; overflow:hidden;'><font face='Courier New'>‧已取件的運單:</font></span></b><span style='width:280; position:relative; float:left;'><font face='Courier New'>&nbsp;&nbsp;&nbsp;&nbsp盡快收回回單, 然後在系統維護有關單號狀態 (錄入“已簽回單”) ‧</font></span>";

but the text after ":" is still in the same position (shown on the attached). why?
17b
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
>>but the text after ":" is still in the same position (shown on the attached). why?

you need to decide how many non-breaking space (&nbsp;) to be used in your HTML, that will determine how your output looks like.

to adjust the position of ":" or any character before or after another character, non-breaking space (&nbsp;) could be added before or after that.
HuaMin ChenProblem resolverAuthor Commented:
I have different number of space right after ":" to the 2 lines. the problem is, the text after ":" on 2 lines, are not in the same horizontal position.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
>>I have different number of space right after ":" to the 2 lines. the problem is, the text after ":" on 2 lines, are not in the same horizontal position.

if you mean that the content is exceeding one line and the second line is actually doesn't aligned according to the position of ":" , well it's too bad to say the proposed solution of using non-breaking space (&nbsp;) may not best suitable for your solution.

you may reconsider to shorter your text OR to use a table instead OR for those lines, try use an image instead of text, that could possibly solve your problem.
HuaMin ChenProblem resolverAuthor Commented:
No, I expect the text right after ":" on 2nd line, should be aligned at the same position of that text, after ":" on line 1.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
if you insist to not using alternative solutions, you can break it into more lines but you need to adjust those spaces accordingly (this will be no perfect solution for you):

 fmsg += "<b><span style='width:230; position: relative; float:left;margin:0px; overflow:hidden;'><font face='Courier New'>‧過期件運單處理:</font></span></b><span style='width:280; position:relative; float:left;'><font face='Courier New'>&nbsp;&nbsp;盡快取回快件, 然後在系統維護有關單號狀態 (錄入“回收未領取包裹”),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 並上報客服或致電客人安排改派‧</font></span><br />";
            fmsg += "<b><span style='width:230; position: relative; float:left;margin:0px; overflow:hidden;'><font face='Courier New'>‧已取件的運單:</font></span></b><span style='width:280; position:relative; float:left;'><font face='Courier New'>&nbsp;&nbsp;&nbsp;&nbsp;盡快收回回單, 然後在系統維護有關單號狀態 (錄入“已簽回單”) ‧</font></span>";
HuaMin ChenProblem resolverAuthor Commented:
17d
Sorry, do you see the red line in above?

I only want the text (after ":") on 2nd line, to aligned to that position. how?
HuaMin ChenProblem resolverAuthor Commented:
If I deduct the space on 2nd line, the text after ":" may be aligned "before" that red line in above.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
to adjust the text lineup, you need to adding the &nbsp; to the place you want to generate the "space" accordingly.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HuaMin ChenProblem resolverAuthor Commented:
I do try to adjust the spaces on either lines, but I cannot ensure the text are aligned to the Red line (as shown in above), and this is what I expect to have.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
as mentioned in my previous comment:

if you mean that the content is exceeding one line and the second line is actually doesn't aligned according to the position of ":" , well it's too bad to say the proposed solution of using non-breaking space (&nbsp;) may not best suitable for your solution.

you may reconsider to shorter your text OR to use a table instead OR for those lines, try use an image instead of text, that could possibly solve your problem.

I'm not sure whether others are agreed with me.
HuaMin ChenProblem resolverAuthor Commented:
Sorry, really the main doubt is to easily align the texts on different line in the same position.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.