Forum Moderators: open

Message Too Old, No Replies

Preparing Text Emails - aligning columns

tabs not being read in Outlook Express

         

txbakers

3:31 am on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm writing a routine whereby the web page prepares an email message (text only) that needs to line up in columns. I have been using the "\t" in Javascript to code for the horizontal tabs.

When I receive the email in Outlook it looks fine. Outlook Express seems to ignore the tabs.
I haven't checked it in other email clients yet, but I'm concerned about finding the settings in OE to read the tabs.

Any ideas about this?

coopster

8:25 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Aren't tabbed values going to differ? I mean let's say you have something like the following where the whitespace in between would represent tabs:

name1 name2
veryverylongname3 name4

Since veryverylongname3 ran into the tabspace for the first tab stop, the next tab stop is not going to allow your columns to line up nicely. Maybe spaces are a better option?

txbakers

2:06 am on Mar 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was able to calculate the number of tabs needed between columns by counting the length of the string.

But I might have to go to fixed spaces ala the old AS/400 coding sheets.

Ugh.

encyclo

2:54 am on Mar 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've just tried a few plain-text emails using tabs, and the tabs are always replaced by spaces when sent. (I tried Gmail and Kontact).

If you are going to stick to plain text, then counting spaces is I think the only way you can go. Even then, you can't be certain that the end user has specified a fixed-width font for plain text emails (I don't), so the spacing is still going to be out.

I think that the only consistent way would to be to use HTML rather than plain text, and use a table to display the date in columns.

txbakers

12:22 pm on Mar 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The way I remember making HTML emails was to create an HTML file and do some type of attachment.

I culdn't just put the HTML code in the body text.

Wasn't there a CDONTS property of MailFormat or something like that? I use a 3rd party mail component, perhaps they have something like that.

Good Will Hunting.

Thanks all.

txbakers

1:37 pm on Mar 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HTML email will work for me.

Thanks all!

coopster

2:56 pm on Mar 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Another old trick for plain text report-formatting using spaces is
sprintf
. The only time any of this is not going to work out well for you though is if a user tends to use a lesser-quality HTML email client, one that doesn't recognize the difference between HTML and plain text headers. HTML rendering is going to squish all those nice spaces out of whack on you unless you wrapped it in <pre> elements ... which of course would show up as <pre> elements in everybody else's personal email client programs. You could always send both formats though and that would cure that issue.