hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : How can I insert spaces on the screen?
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

How can I insert spaces on the screen?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-10-2002, 08:07 AM
AC1 AC1 is offline
Newbie
 
Join Date: Aug 2002
Location: Originally from Bolton, England. I have been working in Brussels, Belgium for the last 2.5 years.
Posts: 29
Question

How can I insert spaces on the screen?


Hi

I want to add 5 spaces inbetween the variable hours_to_complete and the text 'Printable'. If I put many spaces inside an echo then it gets displayed as a single space.

I also tried using multipule &#32 characters, but that got interpretted as a space when I saved the code and so resulted in only 1 space.

<?
echo("Hours to complete course: ");
echo($hours_to_complete);

echo(" ");
echo("Printable: ");
echo($printable);
?>

Thanks in advance for your help,
Andy

Reply With Quote


Sponsored Links
  #2  
Old 09-10-2002, 08:18 AM
Noldar Noldar is offline
Web Hosting Evangelist
 
Join Date: Dec 2001
Location: Ponchatoula, LA
Posts: 497
Use
PHP Code:
&nbsp
for spaces, so your code would be
PHP Code:
echo("Hours to complete course:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); 
echo(
$hours_to_complete); 
Richard

__________________
Enigma Hosting
"I wasn't speeding, I was qualifying!"

Reply With Quote
  #3  
Old 09-10-2002, 08:26 AM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
Yes this isn't a PHP problem, simply the way HTML renders.

You might like to consider using a table rather than lots of blank spaces.

Reply With Quote
Sponsored Links
  #4  
Old 09-10-2002, 08:27 AM
AC1 AC1 is offline
Newbie
 
Join Date: Aug 2002
Location: Originally from Bolton, England. I have been working in Brussels, Belgium for the last 2.5 years.
Posts: 29
Hi Richard,


Thanks for your quick response.

That did the trick.


Cheers

Andy

Reply With Quote
  #5  
Old 09-10-2002, 09:43 AM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705
Quote:
Originally posted by Rich2k
You might like to consider using a table rather than lots of blank spaces.
Tables are not to be used for layout. It violates the W3C spec:

Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.

See also:

http://wdvl.internet.com/Authoring/S...itioning/Toss/
http://www.alistapart.com/stories/practicalcss/

Google for more

Reply With Quote
  #6  
Old 09-10-2002, 09:44 AM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
What a load of BS.... try to find me a website (other than w3.org) that doesn't use tables for layout!

If you use % in tables it's highly unlikely you would ever need to scroll horizonally

of course this bit of code from the front page of w3.org is quite funny

Code:
<table
summary="Layout table: The first cell contains a navigation bar of W3C technologies, the second contains news, and the third another navigation bar of W3C pages."
 border="0" width="99%" cellspacing="0" cellpadding="10">

Reply With Quote
  #7  
Old 09-10-2002, 09:49 AM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
Actually I'll correct myself. http://www.parliament.uk 's new site seems to make very good use of CSS

Of course those poor souls still using Netscape 4.x or Lynx are up the creek with pure CSS sites.

And then those browsers that decide to use XHTML 2.0 in the future will break all previous web sites (http://news.com.com/2100-1023-949492.html)

I simply do not understand the mentalilty of some of the stuff the W3C comes out with sometimes.

Reply With Quote
  #8  
Old 09-10-2002, 03:20 PM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705
Quote:
Originally posted by Rich2k
What a load of BS.... try to find me a website (other than w3.org) that doesn't use tables for layout!
http://www.sgtaylor.com/
http://www.alistapart.com/
http://www.alistapart.com/stories/betterliving/
http://www.thenoodleincident.com/tut...son/boxes.html
http://glish.com/css/
http://www.bluerobot.com/
http://www.bluerobot.com/web/layouts/
http://www.meyerweb.com/eric/css/
http://www.meyerweb.com/eric/css/edge/

Hell, even the New York Public Library:
http://www.nypl.org/styleguide/

A free blogging tool:
http://www.pmachine.com/features.php

Quote:
Originally posted by Rich2k
Of course those poor souls still using Netscape 4.x or Lynx are up the creek with pure CSS sites.
In short, sweet words: CSS1 support is at least partially available for more than 96% of the current browser population, with a good CSS2 support for about 80% of today's browsers.

Less people have Flash than are CSS compatible. Yet people here seem to love websites with fancy Flash deisgns that can not be navaigated by many.

And about that text browsing (lynx) and about people who use cell phones to access the net and those with disabilites?

HTML does not take them into account. XHTML is a better replacement for them as it increases accessibility:

The future of the web is accessibility.

Your content must be accessible to disabled readers. More importantly, your content must be accessible to other computers. Computers will be pumping your site into more intelligent search engines, which will need to glean meaning from your document structure, not just the raw text. Computers will be automatically downscaling your page for smaller screens . Computers will be picking out the content in a page and automatically hiding the index and table of contents.

Computers can understand XML. Computers can't understand complex HTML that uses what are supposed to be structural elements (like TABLE) to layout your content.

Furthermore, as we have more and more versions of browsers out there in the wild, it becomes harder and harder to support them and test in all of them. The only viable solution is "graceful degredation". Code for the standards. Hope the browsers implement the standards.


Also:

The whole point of XHTML is to make the semantic structure of a web page more obvious. You're not laying out a magazine page here; you're structuring information, and adding some optional tips (I can override any formatting in your page at the touch of a button) on how it might be formatted. The information and its semantic structure is the important thing, not the presentation. If the presentation is the important thing, send me a paper magazine

And:

W3C is looking to the future. It sees the very real possibility of the Web becoming more than a bunch of largely static pages that you surf with browsers whilst sitting in front of a PC. On one front, the separation of content and presentation is allowing users to stream news straight to their desktop, to build new interfaces without changing any underlying data (have you seen the Google-like Amazon.com interface?). On another front, the Web is moving to cellphones, set-top boxes, refrigerators, you name it. And if there isn't some standard language in which all these devices can communicate, some easy way for MyDesktop to get what it needs from UberNews.alt without hiccups, then this future is not going to happen.

Heres a nice little pearl of wisdom:

The zen of web design is understanding that HTML means that all clients will (should) be able to view your page, not that they will all be able to view your page as you view it or as you intended for them to view it.

And lets take some advice intended for pros who do this for a living how it can save companies money:

http://hotwired.lycos.com/webmonkey/02/33/index1a.html

And going back to the browsers issue:

http://www.alistapart.com/stories/tohell/

As well as:

http://www.gerbilbox.com/newzilla/general/general03.php

Which lets you know Mozilla is a browser design to adhere to the webstandards.

And about lynx, it works fine with a CSS heavy site. I use lynx all the time. But people who have poor code that doesnt even validtate as html 4.01 focres me to use a gui browser. Its the wanna be webmasters who dont know what a div tag is that kill accessibility.

Quote:
Originally posted by Rich2k
And then those browsers that decide to use XHTML 2.0 in the future will break all previous web sites
XHTML 2 isnt the current recomndation though, and wont be for a while. They will be taking suggestions through Januray and will probably make it a recomendation sometime midsummer. Until than XHTML 1 is the spec recomended by wc3 as well as webstandards.org:

http://www.webstandards.org/about/

And XHTML 1 is backwards compatible due to the fact its a subset of HTML 4.

Any website I design is XHTML 1 Strict complaint and looks fine in lynx, mozilla, IE 5+, and NS 4+. It takes a lot more to get it to look right in ****ty browsers due to the fact that they are not compliant. If all browsers were complaint, my work would be cut in half.

Use of tables is fine to display data, but should not be used purely as a means for layout. The web is not about typography. Have you tried browsing the web on a Palm Pilot? A lot easier with sites that are complaint than sites that have huge tables full of images that take up twice the size of the screen.

Reply With Quote
  #9  
Old 09-10-2002, 03:50 PM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
Fair enough, however in the case of the original request it looks like it's possibly the sort of thing which may contain a number of additional sets of data. If so then tables are certainly the best thing to display the data. If it were simply to be by itself then sure there are other ways around it.

Interestingly mozilla.org isn't written to XHTML 1.0 compliance... infact it doesn't even validate to HTML 4.01 or HTML 3.2... but that's just being picky

Yes there are standards but the great thing about the technology is people find a way to improve and extend it. There are some great features available in IE... of course you should make sure it's compliant with other browsers as well. Designing for simply one browser is a bad thing to do.

Reply With Quote
  #10  
Old 09-10-2002, 06:09 PM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705
Quote:
Originally posted by Rich2k
Fair enough, however in the case of the original request it looks like it's possibly the sort of thing which may contain a number of additional sets of data. If so then tables are certainly the best thing to display the data. If it were simply to be by itself then sure there are other ways around it.
For data, thats ideal for tables. But images that are cut up and than pieceds together with tables as well as sites like this:

http://netstarhost.com/
http://www.axxishost.com/
http://www.silicon-edge.com/

(I just pulled those at random from shared hosting offers)

...are not in compliance and will give disabled people trying to browse the net as well as many other interfaces, a very hard time.

Tables are great and do have a purpose. See here:

http://www.w3.org/WAI/GL/wcgl-last-call

(oddly enough, if you follow the link at the top to teh linear version, it leads you here http://www.w3.org/WAI/GL/wcgl-last-call-linear.html and the link now lets you switch to tabular. The reason is tables give a lot of currently uncommon tools of accessing the net a hard time)

The thing that had me thiking tables were being used for layout was "lots of blank spaces". Usually people use lots of blank spaces to spread thngs out and play typographer. Thats not how the web is supposed to work. Maybe a few years ago when every web page was supposed to look the same no matter who was looking at it, but no more. The future of the web is accessibility and keeping that in mind, people will be visintg your website from their cell phone, palm pilot, watch, toaster, TV, and many more. Warner ten Kate emphasized this (a link is found on the last link I just gave you) here:

http://lists.w3.org/Archives/Public/...nMar/0339.html

And about Mozilla.org being filled with tables and far from validating in any sort of way, yes, Im aware, I sent them a nasty email a long time ago.

In a perfect world every browser would be 100% complaint. Than I would write for spec and evryone would be happy, even people who surf the web on their toaster.

Reply With Quote
  #11  
Old 09-10-2002, 06:13 PM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
or get their fridge to order the shopping

Reply With Quote
  #12  
Old 09-10-2002, 06:51 PM
benoire benoire is offline
Registered User
 
Join Date: Jul 2001
Location: Coventry, England
Posts: 130
I agree with all the comments about standards compliancy, using CSS instead of tables etc, however, when you quote

Quote:
You're not laying out a magazine page here; you're structuring information, and adding some optional tips (I can override any formatting in your page at the touch of a button) on how it might be formatted. The information and its semantic structure is the important thing, not the presentation. If the presentation is the important thing, send me a paper magazine
this isn't strictly true... at least, whilst it may be the vision of how the web should be, in reality its not always like this... some people like to see nice sites, they like to see typography etc etc. The web isn't simply a way to provide information, it is there for presentation too - how many newspapers or magazines do you think would sell if they were just pages of text with no layout etc to them?

That's not to say the way data is stored is not important - it is important that it can be accessed via different media, however it should also be well presented within that media through the use of CSS etc. If someone chooses to surf the web with Lynx or on their toaster without any interest in presentation/images etc, that's their choice, however this is not the way most people surf the web. I for one enjoy visiting well presented sites, and like the variation you see across the web. Whilst surfing with text-only browsers has its uses at times, for me, and I guess most people, seeing 'nice' looking sites is an integral part of the 'surfing experience' (Unfortunately I can't think of better words than those to describe this at the mo as I'm shattered )

Reply With Quote
  #13  
Old 09-10-2002, 08:27 PM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705
But you can make websites that look nice and validate. You just need to know what you are doing. These are perfect examples:

http://www.alistapart.com/
http://www.bluerobot.com/

Right now many people use desktop PCs, but they are being replaced, and XHTML 1 is supposed to be a stepping stone to the new web, where cell phones, toasters, fridges, palm pilots, watches and TVs all surf the web. That is why XHTML 1.0 is 100% backwards complaint (CSS is another story for NS 4 users, they will just see unformatted test in a linear fashion).

But in the end, the web should not look the same everywhere you view it. It needs to migrate fully to XML, which computers, search engines, pal pilots, etc can and do understand. They can not understand HTML. HTML is just that, a "mark up language", which is fine if everyone is using PCs, but is horrible when people use palm piloots, watches, etc. You need XML, which is something computers can break down and restructure accordinly adn that is the purpose of XHTML 1.0 to form a bridge between mark up language to the new web of seperating content versus layout.

Does it make it harder at first? Yes. XHTML is very strict compared to HTML. Is it the future of the web? Yup. Im just gettting ready early. HTML 4.01 is still a valid spec, but even in that, they dont want you using tables for layout. XHTML is just the bridge to the future. The longer you wait, the more work you will have to do.

Reply With Quote
  #14  
Old 09-11-2002, 12:36 AM
Alturus Alturus is offline
Newbie
 
Join Date: Aug 2002
Location: Canada
Posts: 22
AcronymBOY: Represent, always enjoy your posts at Ars

I'm a strong advocate of CSS/XHTML and the fact that tables are clumsy; for stated reasons. My site which validates 100% will never touch a table.
http://www.webhostingtalk.com/showth...threadid=73554

Reply With Quote
  #15  
Old 09-11-2002, 12:57 AM
Acronym BOY Acronym BOY is offline
Web Hosting Master
 
Join Date: Mar 2002
Location: Westbury, LI NY
Posts: 1,705
Fancy meeting an Arsian over here. Seems we tend to over run the internet to the envy of slashdotters everywhere.

Its always nice to meet a compliant coder as well

Could you tell I blatantly stole content from a few Arsians?

http://arstechnica.infopop.net/OpenT...3&m=1190911035

Youve got mail.

edit: this thread has gone way way way off topic

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
The DIY Website Revolution Will be Televised Web Hosting News 2013-05-17 12:34:27
Posterous Shuts Down Today, Here Are Some Alternatives Blog 2013-04-30 17:26:02
Trustwave Launches Cloud-Based Authentication Solution MyIdentity Web Hosting News 2011-12-06 21:03:44
iPhone 5 Predictions Blog 2011-10-03 20:52:20
Web Host pair Networks Breaks Ground on Green Las Vegas Data Center Web Hosting News 2011-07-07 13:48:45


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?