Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    How to Indent an HTML Paragraph (Access 2000)

    I am using code in my Access 2000 database to write a file (Print #1, etc.) that is a proper HTML file when the code is finished. I now want to indent a whole section of text in the resulting displayed page. For single line entries I'm using Tab(4) but that won't work for a long string that will be wrapped when it is displayed. The source of this text will be a long string in most cases. I have looked at instructions for using margin-left but I don't understand what I'm reading!

    Can someone offer a suggestion or point to an understandable instruction?

    Thanks,
    Bill

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: How to Indent an HTML Paragraph (Access 2000)

    One 'dirty shortcut' to achieve this without having to learn about stylesheets etc is to wrap the paragraphs you wanted indented in the blockquote tag.
    Regards
    John



  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Indent an HTML Paragraph (Access 2000)

    This is not an Access question, it is about HTML. I will move this thread to the Web design forum.

  4. #4
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: How to Indent an HTML Paragraph (Access 2000)

    That sounded like a good idea but the result doesn't look very good. For one thing, the lines don't wrap at teh window edge like I had hoped they would. It sounds like I need to learn a lot more about designing web pages. I'll look at other alternatives and see if I come up with anything.

    Thanks,
    Bill

  5. #5
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: How to Indent an HTML Paragraph (Access 2000)

    Good point! When I started on this part of my project I didn't connect it with web design. What I'm actually creating is an email message in HTML format -- a summary of the mailing that my database has just completed. After you-all connected my questions to web design I forgot to go looking for an appropriate place to ask the questions.

    Bill

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How to Indent an HTML Paragraph (Access 2000)

    What do you mean by "a section"? Let's imagine your section is between a <div> and a </div> tag. You could insert an inline style rule into the <div> tag such as <div style="margin-left:20px">. That would place a margin outside the entire section on the left. If instead you want to create a blank area inside the <div>, you could use <div style="padding-left:20px">.

    Added: The W3C has a diagram showing the relationship between margins, padding, and borders -- the box model: http://www.w3.org/TR/CSS2/box.html.

  7. #7
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: How to Indent an HTML Paragraph (Access 2000)

    My Access database is constructing an email message in HTML format in a file that will become the body of an email message -- a summary of the actions of the database that were initiated by the user. This "section" is simply up to several lines of text that I would like to indent under a heading line. This text may be longer than one line so I would like for it to wrap at the edge of the window in the resulting email message. Your suggested style may solve the problem. I'll try it and see. I'll also follow the link you provided and see what I can learn there.

    Thanks,
    Bill

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How to Indent an HTML Paragraph (Access 2000)

    Usually text wraps automatically. However, if you use the <pre> (pre-formatted) tag or the NOWRAP attribute, or a few style rules that emulate these HTML features, then the text might not wrap.

  9. #9
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: How to Indent an HTML Paragraph (Access 2000)

    Good point! I had forgotten that the code that was writing the quoted text was inside a <pre> block! I've fixed that and it looks pretty good.

    Thanks,
    Bill

  10. #10
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: How to Indent an HTML Paragraph (Access 2000)

    I tried your suggested <div> with style and it worked fine. It does introduce a blank line before and after the block of text. Is there a way to eliminate those blank lines if I decide that I want to?

    Thanks,
    Bill

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How to Indent an HTML Paragraph (Access 2000)

    It depends on what is causing the blank lines. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> If they are not being inserted by your code, then perhaps they are margins? You can set the top, right and bottom margins to 0 in your style tag.

    <code><div style="margin:0 0 0 20px"></code>

    (Note: you can remember the sequence of these combined properties by reference to the clock: top-right-bottom-left = 12:00-3:00-6:00-9:00)

  12. #12
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: How to Indent an HTML Paragraph (Access 2000)

    The blank lines don't appear to be inserted by my code but specifying the 0 margins didn't make any difference. Here is the sequence of code that is involved:

    Print #1, "Message Body Text:</pre><div style='margin:0 0 0 20px'>"
    Print #1, Me!MsgBodyBox
    Print #1, "</div><pre>"

    Of course, the 2nd line refers to the text box that contains the text. All of the other lines in the resulting page are written to the file by separate Print statements without introducing any blank lines so I don't think that is causing it. Would the <pre> or the <div> introduce a break like that on its own? I assume the apostrophes are OK in place of quotes in that string since the indent part of it is working. There are other alternatives for the apostrophes if they might be the problem.

    This is not a big concern; I'm primarily interested in learning while I'm doing this.

    Thanks,
    Bill

  13. #13
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How to Indent an HTML Paragraph (Access 2000)

    In the first line, it's possible that the browser has to insert a line break between </pre> and <div>. Is the "heading" supposed to be on the same line as the content?

    On the third line, perhaps the same again.

    How about adding style="margin:0" to your <pre> tags to see whether that helps?

  14. #14
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: How to Indent an HTML Paragraph (Access 2000)

    No the heading is supposed to be on a separate line but right now there is a blank line between it and the beginning of the text. I added the style you suggested to the </pre> after the heading line and to the <pre> after the text section and that did eliminate the blank line that was appearing after the text section. I'll look at it again tomorrow and see if there is anything else I can try.

    Thanks for the suggestions.

    Bill

  15. #15
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How to Indent an HTML Paragraph (Access 2000)

    On the <pre></pre> block before the indented <div>, the style rule needs to be in the <pre> tag (it will be ignored in the </pre> tag).

Page 1 of 2 12 LastLast

Posting Permissions

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