Re: WIDTH attribute for peformatted text

Discussion in 'HTML' started by Jud McCranie, Oct 1, 2005.

  1. Jud McCranie

    Jud McCranie Guest

    >OK, then what is the best way to have fixed-width text, with a
    >parameter telling the width of the line (so the browser can adjust the
    >size to get wide lines all on the screen)?
    >---


    I should explain what I'm doing. I'm trying to make a program
    generate HTML output for its reports. They all need fixed-width
    fonts. Some of the reports range from 75 to 132 characters wide. I
    want the recipient of the HTML file to be able to view the file
    without any horizontal scrolling, and also to have it nearly fill the
    width of the screen, no matter what screen resolution the recipient
    has, etc. I've found out about setting the font size in <P style
    ....>, but I don't know how to make it be the appropriate size. (<pre>
    is listed as depreciated, but I don't know what replaces it.)

    How can I do that?
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 1, 2005
    #1
    1. Advertising

  2. Jud McCranie wrote:
    >>OK, then what is the best way to have fixed-width text, with a
    >>parameter telling the width of the line (so the browser can adjust the
    >>size to get wide lines all on the screen)? ---

    >
    > I should explain what I'm doing. I'm trying to make a program
    > generate HTML output for its reports. They all need fixed-width
    > fonts. Some of the reports range from 75 to 132 characters wide. I
    > want the recipient of the HTML file to be able to view the file
    > without any horizontal scrolling, and also to have it nearly fill the
    > width of the screen, no matter what screen resolution the recipient
    > has, etc. I've found out about setting the font size in <P style
    > ...>, but I don't know how to make it be the appropriate size. (<pre>
    > is listed as depreciated, but I don't know what replaces it.)


    I believe the width attribute was shown as deprecated, not the pre
    element.

    Aren't you really just looking for normal paragraphs or divs that
    contain fixed-pitch fonts? So far, I haven't seen you describe anything
    that that wouldn't deliver.

    What's the URL?


    --
    Blinky Linux Registered User 297263
    Killing All Posts from GG: http://blinkynet.net/comp/uip5.html
    Blinky the Shark, Oct 1, 2005
    #2
    1. Advertising

  3. Jud McCranie wrote:

    >>OK, then what is the best way to have fixed-width text, with a
    >>parameter telling the width of the line (so the browser can adjust the
    >>size to get wide lines all on the screen)?
    >>---

    >
    >
    > I should explain what I'm doing. I'm trying to make a program
    > generate HTML output for its reports. They all need fixed-width
    > fonts.


    Style it, example;
    PRE { font-family: courier, "courier new", monospace; }

    Some of the reports range from 75 to 132 characters wide. I
    > want the recipient of the HTML file to be able to view the file
    > without any horizontal scrolling, and also to have it nearly fill the
    > width of the screen, no matter what screen resolution the recipient
    > has, etc. I've found out about setting the font size in <P style
    > ...>, but I don't know how to make it be the appropriate size. (<pre>
    > is listed as depreciated, but I don't know what replaces it.)


    PRE element is not deprecated, the 'width' property is. Not use what you
    mean, do you want to scale the actual font size to fit the browser
    window regardless of window size? If you, not really without some wild
    JavaScript. I think not very practical. If the report is 132 characters
    wide many folk are going to have to horizontal scroll unless they have a
    large monitor at greater than 800x600 res. If they can alway +/-
    there browser text size Moz/Firefox CTL + or CTL - if they wish.

    > How can I do that?
    > ---
    > Replace you know what by j to email



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Oct 1, 2005
    #3
  4. Jud McCranie

    Rincewind Guest

    On Fri, 30 Sep 2005 23:57:01 -0400, Jud McCranie wrote:

    >>OK, then what is the best way to have fixed-width text, with a
    >>parameter telling the width of the line (so the browser can adjust the
    >>size to get wide lines all on the screen)?
    >>---

    >
    > I should explain what I'm doing. I'm trying to make a program
    > generate HTML output for its reports. They all need fixed-width
    > fonts. Some of the reports range from 75 to 132 characters wide. I
    > want the recipient of the HTML file to be able to view the file
    > without any horizontal scrolling, and also to have it nearly fill the
    > width of the screen, no matter what screen resolution the recipient
    > has, etc. I've found out about setting the font size in <P style
    > ...>, but I don't know how to make it be the appropriate size. (<pre>
    > is listed as depreciated, but I don't know what replaces it.)
    >
    > How can I do that?
    > ---
    > Replace you know what by j to email


    If I understand correctly, I think what you need to do is put the text
    inside a <div></div> with a width set to 95%(nearly full screen) this way
    when the browser window is resized or with lower resolution screens the
    text will flow within the <div></div>.
    Rincewind, Oct 1, 2005
    #4
  5. Jud McCranie <> wrote:

    > I should explain what I'm doing.


    Yes. And it's generally best to _start_ from the original problem, instead
    of assumed solution (which so often turns out to be a dead end, and nobody
    can help you in the right direction if he doesn't know where you were
    heading to).

    > I'm trying to make a program
    > generate HTML output for its reports.


    Wait a second. In which context? WWW, intranet, or perhaps just one
    computer? And what reports?

    > They all need fixed-width fonts.


    That's almost probably wrong analysis in all contexts. If something "needs"
    such things, it's probably a legacy application, so why would it "need"
    HTML as a data format?

    > Some of the reports range from 75 to 132 characters wide.


    (Sounds like a legacy application, originally designed for line printer
    output.)

    On the web, the minimum line width you can assume is exactly zero.
    Even in other contexts, avoid imposing arbitrary limits, even when they
    might not exceed the dimensions of your current display in fullscreen mode.

    > I
    > want the recipient of the HTML file to be able to view the file
    > without any horizontal scrolling, and also to have it nearly fill the
    > width of the screen, no matter what screen resolution the recipient
    > has, etc.


    Sounds like you are defining a Mission Impossible for yourself, building a
    logical contradiction into the requirements.

    Instead of telling what you want, why don't you describe the structure and
    purpose of the data?

    > I've found out about setting the font size in <P style
    > ...>,


    Too bad. I hope you can unlearn it.

    > (<pre>
    > is listed as depreciated, but I don't know what replaces it.)


    No, <pre> is not depreciated, and it is not deprecated (two different
    things). The width attribute in it is, but that's rather irrelevant, given
    the fact that it was vaguely defined (semantically) and was never
    implemented in any browser of some general importance.

    So what made you think you need to preserve the exact line structure and
    spacing of the HTML source in the visual presentation (that's what <pre>
    means) _and_ not preserve it?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Oct 1, 2005
    #5
  6. Jud McCranie

    Jud McCranie Guest

    On 1 Oct 2005 04:10:18 GMT, Blinky the Shark <>
    wrote:

    >Aren't you really just looking for normal paragraphs or divs that
    >contain fixed-pitch fonts? So far, I haven't seen you describe anything
    >that that wouldn't deliver.


    That's right, but I would like to make it so that the user doesn't
    have to scroll horizontally, if possible. And so that the font isn't
    too small. I'm a novice user of HTML, so I don't yet know how to
    accomplish it with DIV.


    >What's the URL?


    There's no URL, these are reports generated by a program that I want
    to attach to email.
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 2, 2005
    #6
  7. Jud McCranie

    Jud McCranie Guest

    On Sat, 01 Oct 2005 09:16:16 GMT, Rincewind
    <> wrote:

    >If I understand correctly, I think what you need to do is put the text
    >inside a <div></div> with a width set to 95%(nearly full screen) this way
    >when the browser window is resized or with lower resolution screens the
    >text will flow within the <div></div>.


    That sounds exactly like what I need, but I'm looking at a reference
    (the one recommended earlier) and I don't see how to set the 95%.
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 2, 2005
    #7
  8. Jud McCranie

    Jud McCranie Guest

    On Sat, 1 Oct 2005 14:27:27 +0000 (UTC), "Jukka K. Korpela"
    <> wrote:

    >Wait a second. In which context? WWW, intranet, or perhaps just one
    >computer? And what reports?


    These reports are generated by my program and are to be emailed (as an
    attachment) to several people.

    >That's almost probably wrong analysis in all contexts. If something "needs"
    >such things, it's probably a legacy application, so why would it "need"
    >HTML as a data format?


    It is a legacy application, of sorts, and if the font isn't fixed
    width, the columns won't line up. The program already puts the
    reports in text files and RTF files. But text files are limited and
    some recipients are having problems with the RTF files. I want to add
    HTML files to have things that text file can't, and to give an option
    to avoid problems for the recipient.

    >(Sounds like a legacy application, originally designed for line printer
    >output.)


    That's right, it goes back to dot matrix printers in the late 80s.


    >Instead of telling what you want, why don't you describe the structure and
    >purpose of the data?


    The data consists of quite a few reports which use fixed spacing, in
    order to make the columns line up. The reports vary from about 75
    characters wide to 132 columns wide. Headings are usually in a larger
    font than the body of the text. Bolding and italics are used. Color
    is planned for the future.

    >So what made you think you need to preserve the exact line structure and
    >spacing of the HTML source in the visual presentation (that's what <pre>
    >means) _and_ not preserve it?


    It does preserve the spacing, but I would like it to look more like a
    printed report. The printed reports and the preview of the reports
    adjust themselves so they display nicely. I would like to have the
    HTML file someone receives be like that. It isn't absolutely
    necessary, but it would be beneficial.
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 2, 2005
    #8
  9. Jud McCranie wrote:
    > On 1 Oct 2005 04:10:18 GMT, Blinky the Shark <>
    > wrote:
    >
    >>Aren't you really just looking for normal paragraphs or divs that
    >>contain fixed-pitch fonts? So far, I haven't seen you describe anything
    >>that that wouldn't deliver.

    >
    > That's right, but I would like to make it so that the user doesn't
    > have to scroll horizontally, if possible. And so that the font isn't
    > too small. I'm a novice user of HTML, so I don't yet know how to
    > accomplish it with DIV.


    I've never done that with <pre>. Why, again must you use <pre>? Sorry
    if I'm being dense.

    >>What's the URL?

    >
    > There's no URL, these are reports generated by a program that I want
    > to attach to email.


    Ew. HTML mail. You know that many people don't read HTML mail, right?
    Here, it goes straight into the Trash folder.


    --
    Blinky Linux Registered User 297263
    Killing All Posts from GG: http://blinkynet.net/comp/uip5.html
    Blinky the Shark, Oct 2, 2005
    #9
  10. Jud McCranie

    Rincewind Guest

    On Sat, 01 Oct 2005 20:28:51 -0400, Jud McCranie wrote:

    > On Sat, 01 Oct 2005 09:16:16 GMT, Rincewind
    > <> wrote:
    >
    >>If I understand correctly, I think what you need to do is put the text
    >>inside a <div></div> with a width set to 95%(nearly full screen) this way
    >>when the browser window is resized or with lower resolution screens the
    >>text will flow within the <div></div>.

    >
    > That sounds exactly like what I need, but I'm looking at a reference
    > (the one recommended earlier) and I don't see how to set the 95%.
    > ---
    > Replace you know what by j to email


    In your html:
    <div id="content"><p>Your text goes here</p></div>

    In your CSS:
    #content{width:95%;}

    or:
    <div style="width:95%;"><p>our text goes here</p></div>
    Rincewind, Oct 2, 2005
    #10
  11. Jud McCranie

    Jud McCranie Guest

    On 2 Oct 2005 02:57:07 GMT, Blinky the Shark <>
    wrote:

    >I've never done that with <pre>. Why, again must you use <pre>? Sorry
    >if I'm being dense.


    Sorry, I don't know much about writing HTML. I found <pre> in "A
    Beginner's Guide to HTML" by the NCSA, which seems to be a little out
    of date. If there is a better way to get fixed-pitch text, I'd like
    to know.

    >> There's no URL, these are reports generated by a program that I want
    >> to attach to email.

    >
    >Ew. HTML mail. You know that many people don't read HTML mail, right?
    >Here, it goes straight into the Trash folder.


    For one thing, it won't go into the trash because these people have
    requested that the file be sent to them. Secondly, this isn't HTML
    mail. The reports are attached to email that says something like "The
    employee vacation list for this week is attached". I already have it
    attaching text and RTF files, I'm adding HTML files.

    I've got my program so that it will create the HTML files the way I
    want them, except for the issue of the width of the file. I may just
    have to pick a size that works well for a maximized browser at
    1024x768. What is the best way to set the font size (for a
    fixed-pitch font)?
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 3, 2005
    #11
  12. Jud McCranie

    Jud McCranie Guest

    On Sun, 02 Oct 2005 09:28:00 GMT, Rincewind
    <> wrote:

    >In your CSS:
    >#content{width:95%;}


    Thanks, I've heard of CSS, but I don't know what it is. What is it?
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 3, 2005
    #12
  13. Jud McCranie

    Jud McCranie Guest

    On Sun, 02 Oct 2005 09:28:00 GMT, Rincewind
    <> wrote:

    ><div style="width:95%;"><p>our text goes here</p></div>


    When I do that, it wraps long lines of text. It can't wrap long
    lines. What I want is to have them left as they are and be visible
    without requiring horizontal scrolling.
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 3, 2005
    #13
  14. Jud McCranie

    Jud McCranie Guest

    On Mon, 03 Oct 2005 10:26:55 -0400, Jud McCranie
    <> wrote:

    >For one thing, it won't go into the trash because these people have
    >requested that the file be sent to them. Secondly, this isn't HTML
    >mail. The reports are attached to email that says something like "The
    >employee vacation list for this week is attached". I already have it
    >attaching text and RTF files, I'm adding HTML files.


    Also, the files are written to the network drive do anyone that wants
    it who isn't on the email list can go out and get it.

    I mentioned possibly sending the fine in 3 or 4 sizes. Maybe the
    recipients can report back which size works for them, and the files
    can be individualized. More programming though, I'd rather be able to
    make only one file that fits all recipients.
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 3, 2005
    #14
  15. Jud McCranie

    Jud McCranie Guest

    On Mon, 03 Oct 2005 10:26:55 -0400, Jud McCranie
    <> wrote:

    >>I've never done that with <pre>. Why, again must you use <pre>? Sorry
    >>if I'm being dense.

    >
    >Sorry, I don't know much about writing HTML. I found <pre> in "A
    >Beginner's Guide to HTML" by the NCSA, which seems to be a little out
    >of date. If there is a better way to get fixed-pitch text, I'd like
    >to know.


    Now I've tried
    <P style="font-size: 12pt; font-family: Verdana; color: black">
    text line 1 <BR>
    text line 2 <BR>
    </P>

    but it wraps long lines, which is unacceptable, of course.
    I've read about <TT> as an alternative to <pre>. What is the best way
    to put in preformatted text and have it not wrap?
    ---
    Replace you know what by j to email
    Jud McCranie, Oct 3, 2005
    #15
  16. Jud McCranie

    Neredbojias Guest

    With neither quill nor qualm, Jud McCranie quothed:

    > On Sun, 02 Oct 2005 09:28:00 GMT, Rincewind
    > <> wrote:
    >
    > ><div style="width:95%;"><p>our text goes here</p></div>

    >
    > When I do that, it wraps long lines of text. It can't wrap long
    > lines. What I want is to have them left as they are and be visible
    > without requiring horizontal scrolling.


    To stop wrapping use style="white-space:nowrap" per applicable line.

    To *reduce* the chance of horizontal scrolling, reduce the font-size.
    Eg. style="font-size:0.7em" (-an em is the user's browser's standard
    font size unless you've adjusted it earlier.) Be aware that a lot of
    people get cranky from small text.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Oct 3, 2005
    #16
  17. Jud McCranie <> wrote:

    > On Sat, 1 Oct 2005 14:27:27 +0000 (UTC), "Jukka K. Korpela"
    > <> wrote:
    >
    >>Wait a second. In which context? WWW, intranet, or perhaps just one
    >>computer? And what reports?

    >
    > These reports are generated by my program and are to be emailed (as an
    > attachment) to several people.


    That still doesn't give much clue. Why do you use HTML as the format,
    anyway? If it's tabulated data and will be E-mailed as an attachment, Excel
    might work much better. After all, recipients could actually work with it,
    reordering columns and whatever.

    > It is a legacy application, of sorts, and if the font isn't fixed
    > width, the columns won't line up.


    It sounds like you need a table. Using preformatted text instead is hardly
    a good idea - we did that in the 1970s, but...

    > The program already puts the
    > reports in text files and RTF files. But text files are limited and
    > some recipients are having problems with the RTF files. I want to add
    > HTML files to have things that text file can't, and to give an option
    > to avoid problems for the recipient.


    You're not describing the structure or the desired functionality.

    >>Instead of telling what you want, why don't you describe the structure
    >>and purpose of the data?

    >
    > The data consists of quite a few reports which use fixed spacing, in
    > order to make the columns line up.


    You're describing line printer oriented presentation, not structure.

    > It does preserve the spacing, but I would like it to look more like a
    > printed report.


    Why?

    > The printed reports and the preview of the reports
    > adjust themselves so they display nicely.


    I guess we'll never know what you are actually trying to accomplish.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Oct 3, 2005
    #17
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewF
    Replies:
    1
    Views:
    740
    Bruce Barker
    Oct 10, 2005
  2. Jonathan N. Little

    Re: WIDTH attribute for peformatted text

    Jonathan N. Little, Oct 1, 2005, in forum: HTML
    Replies:
    1
    Views:
    318
    Jud McCranie
    Oct 1, 2005
  3. Blinky the Shark

    Re: WIDTH attribute for peformatted text

    Blinky the Shark, Oct 1, 2005, in forum: HTML
    Replies:
    5
    Views:
    323
    Blinky the Shark
    Oct 3, 2005
  4. Toby Inkster
    Replies:
    0
    Views:
    355
    Toby Inkster
    Oct 1, 2005
  5. Coder
    Replies:
    1
    Views:
    681
    Cowboy \(Gregory A. Beamer\)
    Jun 24, 2006
Loading...

Share This Page