alignment

Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: alignment

  1. #1
    Join Date
    Dec 1969
    Posts
    222

    Default alignment

    hi all,<BR> I&#039;m sending a text email; with three headings at the top then the appropriate rs below each of these as listed below:<BR>Problem: what is the best way to get the rs to align properly under the correct headings:<BR>eg.<BR>NAME PRICE ONE PRICE TWO<BR>blah blah $34.34 $23.232<BR>blach blahg $99.33 $27.202<BR><BR>Currently if the name is shorter or longer the row gets push over or pulls back with the headings rmaining still.<BR><BR>"NAME PRICEONE PRICETWO" &vbCrlf&_ <BR>""&rs("name")&" "&rs("price_one")&" "&rs("price_two")& " "&vbCrlf&_<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    11,247

    Default RE: alignment

    Easiest way is to make an HTML table in your mail

  3. #3
    Join Date
    Dec 1969
    Posts
    222

    Default RE: alignment

    this has to be a text base email...I alerady have an HTML version...is this alignment even possible with a text base email? do I need to write a function of some sort??<BR>thanks

  4. #4
    Join Date
    Dec 1969
    Posts
    18,177

    Default If it's plain text...

    .. you can just pad the strings with spaces to enforce the string lengths that you want.<BR><BR>You&#039;ll also need to truncate anything longer than the allotted # of characters.<BR><BR>Something like this:<BR>Dim s<BR> s = "This is 30 characters234567890XXXXX"<BR> s = FitSpace(s, 30)<BR><BR> Response.Write chr(34) & s & Chr(34)<BR><BR>Function FitSpace(str, max)<BR><BR>Dim out<BR> If Len(str) &#062; max Then<BR> out = Left(str, max - 3) & "..."<BR> Else<BR> out = str<BR> End If<BR><BR> If max &#062; Len(str) Then<BR> out = str & Space(max - Len(str))<BR> End If<BR><BR> FitSpace = out<BR><BR>End Function


  5. #5
    Join Date
    Dec 1969
    Posts
    11,247

    Default And

    It would help if you used a Fixed width Font such as Courier<BR><BR>

  6. #6
    Join Date
    Dec 1969
    Posts
    18,177

    Default Saved to my knowledge base..

    http://www.27seconds.com/kb/article_view.asp?id=53

  7. #7
    Join Date
    Dec 1969
    Posts
    96,118

    Default Ummmm...

    Why do you do the second IF test even when you know it will fail?<BR><BR>Function FitSpace(str, max)<BR> If Len(str) &#062; max Then<BR> FitSpace= Left(str, max - 3) & "..."<BR> ElseIf Len(str) &#060; max Then<BR> FitSpace = str & Space(max - Len(str))<BR> Else<BR> FitSpace = str<BR> End If<BR>End Function<BR><BR>

  8. #8
    Join Date
    Dec 1969
    Posts
    96,118

    Default Okay, I give up...

    ...If it has to be a TEXT-based email, as he said, how does he set the font, at all???<BR><BR>

  9. #9
    Join Date
    Dec 1969
    Posts
    96,118

    Default I don't think you can...

    You can use the suggestions on padding with spaces, but if the user has his/her email reader set up to default to a proportional width font, then even that won&#039;t help.<BR><BR>Your best bet would probably be to use tabs:<BR><BR>&#060;%<BR>body = body & FormatCurrency(xyz) & vbTab & FormatCurrency(abc) & vbTab & FormatNumber(num) & vbNewLine<BR>...<BR>%&#062;<BR>

  10. #10
    Join Date
    Dec 1969
    Posts
    96,118

    Default Even using tabs...

    ...you&#039;ll want to pad or shorten the names somewhat. But if somebody&#039;s name is "Mommy Wow" and another person&#039;s name is "Ili Lif" I doubt you can get the padding/shortening right without tons of code, anyway.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •