Re: What do you mean?
| From: | David Robley | Date: | Wed, 23 Jan 2002 23:02:16 +0000 |
| Subject: | Re: What do you mean? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81790@lists.php.net to get a copy of this message | ||
scott@abcoa.com (Scott Fletcher) wrote in
news:20020123222617.59880.qmail@pb1.pair.com:
> What do you mean? There is a php function that can clean up the
> carriage return and line feed. There's a php function somewhere that
> will fix up the amount of spaces for each lines to make the end of each
> line to be all aligned. So, what would it be?
There are a few good reasons why such a thing wouldn't work (but see the
exception below). Recall that browsers generally ignore white space
(spaces, tabs and new lines) and simply render a number of white space
characters as one space.
Then, what happens if you set your line to a lenght suitable for a
particular resolution and font size, and your viewer is using different
settings?
One possible solution, although a bit clunky, would be to use a wordwrap
function to output your text to a given width, and enclose the whole lot
in <PRE> tags. White space will be rendered faithfully in <PRE> but
normally the browser will default to a fixed font, unless the user has
selected an alternate font and if that is a proportional font your output
is screwed.
The best way to handle it would be as someone has already suggested, use
HTML and perhaps CSS to format your output.
--
David Robley
Temporary Kiwi!