Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: WIDTH attribute for peformatted text

Reply
Thread Tools

Re: WIDTH attribute for peformatted text

 
 
Jud McCranie
Guest
Posts: n/a
 
      10-01-2005
>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
 
Reply With Quote
 
 
 
 
Blinky the Shark
Guest
Posts: n/a
 
      10-01-2005
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
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-01-2005
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
 
Reply With Quote
 
Rincewind
Guest
Posts: n/a
 
      10-01-2005
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>.
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      10-01-2005
Jud McCranie <(E-Mail Removed)> 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


 
Reply With Quote
 
Jud McCranie
Guest
Posts: n/a
 
      10-02-2005
On 1 Oct 2005 04:10:18 GMT, Blinky the Shark <(E-Mail Removed)>
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
 
Reply With Quote
 
Jud McCranie
Guest
Posts: n/a
 
      10-02-2005
On Sat, 01 Oct 2005 09:16:16 GMT, Rincewind
<(E-Mail Removed)> 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
 
Reply With Quote
 
Jud McCranie
Guest
Posts: n/a
 
      10-02-2005
On Sat, 1 Oct 2005 14:27:27 +0000 (UTC), "Jukka K. Korpela"
<(E-Mail Removed)> 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
 
Reply With Quote
 
Blinky the Shark
Guest
Posts: n/a
 
      10-02-2005
Jud McCranie wrote:
> On 1 Oct 2005 04:10:18 GMT, Blinky the Shark <(E-Mail Removed)>
> 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
 
Reply With Quote
 
Rincewind
Guest
Posts: n/a
 
      10-02-2005
On Sat, 01 Oct 2005 20:28:51 -0400, Jud McCranie wrote:

> On Sat, 01 Oct 2005 09:16:16 GMT, Rincewind
> <(E-Mail Removed)> 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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop Down List Border Width vs Text Box Border Width Coder ASP .Net 1 06-24-2006 01:27 PM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
Re: WIDTH attribute for peformatted text Blinky the Shark HTML 5 10-03-2005 06:04 PM
Re: WIDTH attribute for peformatted text Toby Inkster HTML 0 10-01-2005 01:56 PM
Re: WIDTH attribute for peformatted text Jonathan N. Little HTML 1 10-01-2005 04:01 AM



Advertisments