Page 1 of 1

Stopping word-wrap

Posted: Wed Jul 20, 2005 12:03 pm
by theda
I know there's the concept of the word wrap in php, but I'm curious, is there a way to STOP word wrap?

Example of what I don't want word-wrapped:
http://dumbass.ionichost.com/?id=source_main

The text kinda bunches up and makes the source code look 00glay... <_<

Posted: Wed Jul 20, 2005 1:26 pm
by Chris Corbyn
It's not PHP but...

Old style (before XHTML) was to use "nowrap" as an attribute... it's no longer valid in XHTML though.

Either, set:

Code: Select all

style=&quote;overflow:auto&quote;
in you DIV or I belive you can use something like:

Code: Select all

white-space: nowrap
But I'd check that on http://www.w3schools.com/css/ first ;)

Posted: Wed Jul 20, 2005 3:46 pm
by theda
This is how you get the source code of the files I used:

Code: Select all

<?
highlight_file("index.php");
?>
^_^;; Kind of difficult to add what you suggest when it'd be useless in the actual file that executes.

Posted: Wed Jul 20, 2005 4:07 pm
by Chris Corbyn
Believe me, I'm more than familiar with that function :P *sigh*

Code: Select all

<div style="width:700px; overflow:auto">
<?php
highlight_file($file);
?>
</div>
or if you're not validating XHTML (I don't think you can anyway if you use highlight_file() or highlight_string()...)

Code: Select all

<div style="width:700px" nowrap>
<?php
highlight_file($file);
?>
</div>