This is a discussion on "Anything similar to PRE tags?" within the Web Page Design section. This forum, and the thread "Anything similar to PRE tags? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Anything similar to PRE tags?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
Anything similar to PRE tags?
Hey all!
I was wondering if there were any tags similar to PRE tags that let you specify a width and still keep the correct formatting? I'm in the middle of creating a jobs site and the spaces that were created when posting a job weren't showing up when you viewed the job - so I applied a PRE tag to display the job with the correct spaces BUT obviously with long paragraphs it stretches accross the page and looks awful! I can't apply a width to it which is annoying - so are there any tags similar that will keep the correct formatting? Or am I going to have to edit the PHP/MySQL stuff (ie. the cause of all my headaches!) Thanks. The link if you need it: http://www.dev.enjoyonline.co.uk/ukj...?vacancy_id=13 |
|
|
|
||||
|
Re: Anything similar to PRE tags?
The type is set as TEXT but I can see in the database it keeps the correct spacing, it just isn't displaying it on the website.
|
|
||||
|
Re: Anything similar to PRE tags?
Hmmm .... maybe you can do a preg_replace for \n to <br> !?
|
|
||||
|
Re: Anything similar to PRE tags?
I'm currently trying str_replace like that but it isn't working, so I'll try preg_replace
|
|
||||
|
Re: Anything similar to PRE tags?
Hmm, it didn't like preg - not sure if I'm doing it right though (complete beginner at this stuff hehe)
|
|
||||
|
Re: Anything similar to PRE tags?
Ohh I got the str_replace to work
Thanks for you help |
|
||||
|
Re: [SOLVED] Anything similar to PRE tags?
Alright! Well done!
|
|
||||
|
Re: Anything similar to PRE tags?
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
||||
|
Re: Anything similar to PRE tags?
correct me if I am wrong, but isnt there a way via css to set a width and height on a pre tag?
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
Re: Anything similar to PRE tags?
.... or maybe use a div set at the right width and a pre inside that.
Or heck, just use a div and set white-space: pre; (is that right syntax?)
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
Re: Anything similar to PRE tags?
Quote:
|
|
||||
|
Re: Anything similar to PRE tags?
Nope
|
|
||||
|
Re: Anything similar to PRE tags?
Quote:
Yeah ... that function would probably be better ... |
|
||||
|
Re: Anything similar to PRE tags?
Quote:
Hmm... never used the white-space: pre before so not sure if it would've worked - but hey, it's one to remember for future reference |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Title Tags, Meta Tags and SEO - Keyword Density or Keyword Spamming? | pctank | Search Engine Optimization (SEO) | 2 | Jul 4th, 2008 11:52 |
| group similar data in a string? | ktsirig | PHP Forum | 1 | Apr 26th, 2008 00:33 |
| [SOLVED] Apple.com : How to do similar navigation? | Ed | Web Page Design | 24 | Oct 28th, 2007 14:28 |
| Learning PhotoShop (or similar)? | Legacy_Staff | Scripts and Online Services | 20 | Dec 8th, 2006 11:20 |
| 2 similar input validations on one form | bldstr | JavaScript Forum | 3 | Jan 30th, 2006 21:27 |