Re: [WSG] Preserve whitespace

2007-12-12 Thread Chris Knowles
Simon Cockayne wrote:
> 
> This is *not* a presentation/layout issue.

from this i gather you mean it doesn't matter how it appears on screen
to the person viewing it - in other words it doesn't matter whether it
visually has any indent or not. In which case you can ignore pre, nbsp,
css as they are all to do with presentation/layout

> 
> I have a field that contains leading blanks (space) characters that the
> user tells me has semantic meaning that they wish to preserve.
> 

as its not a presentation issue then presumably it must be a
programmatic one whereby the HTML hasn't reached it's end use when it
gets displayed in the browser. From there I assume it will be further
accessed via the DOM or by scraping or something, where the amount of
whitespace at the beginning of the content gives meaning to it?

If all the above is correct, then I don't see why you need to do
anything other than generate the HTML with the right amount of space in
it like:

content

the browser will only display one of the spaces in the above but they
will still remain in the source - they won't be stripped out at any stage

or have I misunderstood your question?

-- 
Chris Knowles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Preserve whitespace

2007-12-12 Thread Hassan Schroeder

Simon Cockayne wrote:


This is *not* a presentation/layout issue.

I have a field that contains leading blanks (space) characters that the 
user tells me has semantic meaning that they wish to preserve.


So what do you mean by "preserve"?

The text nodes inside foo and   foo aren't equal
in value, regardless of how they're displayed; they're strings with
lengths of 3 and 5 characters, respectively.

The space characters are certainly there, so the issue you're trying
to address isn't at all clear...

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Preserve whitespace

2007-12-12 Thread Joseph Taylor

Upon reading the reponses, one thing remains clear:

Without an example to look at, the options have no relevance.

You claim your client says the empty space is part of the information?  
Show us.


Only then can the appropriate solution be isolated.

Slightly off-topic, but perhaps not:

I have a client who had a site built by me several years ago. ( 
http://jewelrealestateagency.com ) The client insisted that all text 
(headings and all) be indented to match the traditional style he 
preferred to see his writing displayed in.


I used CSS ( p{text-indent:1.0em} ) and they're happy.  At the same 
time, no actual space is added to the information since I cannot see how 
/nothing/ is supposed to equal /something/.  Again an example would 
clear this up.


Joseph R. B. Taylor, Designer/Developer
-
Sites by Joe, LLC
"Clean, Simple and Elegant Web Design"
Phone: (609) 335-3076
Fax: (866) 301-8045
Web: http://sitesbyjoe.com
Email: [EMAIL PROTECTED]


Simon Cockayne wrote:

Hi,

Ok...I asked a question about how to preserve whitespace...I got a 
variety of answers (use PRE, use nbsp, use CSS).


I shall clarify the question.

This is *not* a presentation/layout issue.

I have a field that contains leading blanks (space) characters that 
the user tells me has semantic meaning that they wish to preserve.



* PRE

If I use PRE, the font will default to some mono fixed-width affair. I 
could use CSS styling to change the PRE default I suppose, but the 
HTML spec advises against this


I believe we could use CSS to style the PRE text in the required 
font…but I have also noted that the HTML spec 
http://www.w3.org/TR/html401/struct/text.html#edef-PRE states:



"The DTD fragment above indicates which elements may not appear within 
a PRE  
declaration. This is the same as in HTML 3.2, and is intended to 
preserve constant line spacing and column alignment for text rendered 
in a fixed pitch font. Authors are discouraged from altering this 
behaviour through style sheets."


What is the downside of using styling in PRE?


* CSS

Whilst I am happy to use CSS to style fonts and presentation et 
cetera...I don't want to use CSS to preserve the leading spaces 
because if CSS is turned off the the leading spaces will be 
lost...won't they?


Also, if the spaces are preserved using CSS styling will the posted 
value of the field contain the leading spaces? (I will test this after 
I make this post).



* NBSP

Someone commented that NBSP is "as wide as a piece of string is long". 
What are the thoughts on this?



Cheers,

Simon





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***
begin:vcard
fn:Joseph Taylor
n:Taylor;Joseph
org:Sites by Joe, LLC
adr:;;408 Route 47 South;Cape May Court House;NJ;08210;USA
email;internet:[EMAIL PROTECTED]
title:Designer / Developer
tel;work:609-335-3076
tel;cell:609-335-3076
x-mozilla-html:TRUE
url:http://sitesbyjoe.com
version:2.1
end:vcard



[WSG] Preserve whitespace

2007-12-12 Thread Simon Cockayne
Hi,

Ok...I asked a question about how to preserve whitespace...I got a variety
of answers (use PRE, use nbsp, use CSS).

I shall clarify the question.

This is *not* a presentation/layout issue.

I have a field that contains leading blanks (space) characters that the user
tells me has semantic meaning that they wish to preserve.


* PRE

If I use PRE, the font will default to some mono fixed-width affair. I could
use CSS styling to change the PRE default I suppose, but the HTML spec
advises against this

I believe we could use CSS to style the PRE text in the required font…but I
have also noted that the HTML spec
http://www.w3.org/TR/html401/struct/text.html#edef-PRE states:


"The DTD fragment above indicates which elements may not appear within
a PREdeclaration.
This is the same as in HTML
3.2, and is intended to preserve constant line spacing and column alignment
for text rendered in a fixed pitch font. Authors are discouraged from
altering this behaviour through style sheets."
What is the downside of using styling in PRE?


* CSS

Whilst I am happy to use CSS to style fonts and presentation et cetera...I
don't want to use CSS to preserve the leading spaces because if CSS is
turned off the the leading spaces will be lost...won't they?

Also, if the spaces are preserved using CSS styling will the posted value of
the field contain the leading spaces? (I will test this after I make this
post).


* NBSP

Someone commented that NBSP is "as wide as a piece of string is long". What
are the thoughts on this?


Cheers,

Simon

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] preserve whitespace

2007-12-11 Thread James Ellis
Hi

You'd have to define a "blank"

is it a tab -> \t, a newline -> \n, a carriage return \r 

You can use pre or you can use "white-space : pre;" to PREserve the whitespace 
in the string appearing in the cell.

  is an html entity for the non breaking space character. You should use 
it when you want just that - a non breaking space to stop a line from 
wrapping (or user white-space : nowrap) - rather than to define any sort of 
fixed width padding or margin, as nbsp is a wide as a piece of string is 
long.

HTH
James


On Wed, 12 Dec 2007 03:09:03 am Simon Cockayne wrote:
> Hi,
>
> 
>
> I have an HTML page and I want to (well my client wants me to) preserve
> leading blanks in the value of a table data cell.
>
> I could use   around the data.
>
> Or I could use an   for each leading blank.
>
> Any others?
>
> What is the "standard" way to do it?
>
>
> Cheers,
>
> Simon
>
>
> ***
> List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
> Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
> Help: [EMAIL PROTECTED]
> ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] preserve whitespace

2007-12-11 Thread Christian Montoya
> - Original Message -
> From: Simon Cockayne
> To: wsg@webstandardsgroup.org
> Sent: Tuesday, December 11, 2007 8:09 PM
> Subject: [WSG] preserve whitespace
>
> Hi,
>
> 
> I have an HTML page and I want to (well my client wants me to) preserve
> leading blanks in the value of a table data cell.
> I could use   around the data.
> Or I could use an   for each leading blank.
> Any others?
> What is the "standard" way to do it?

I would recommend  over  , that way the data itself would stay clean.

-- 
--
Christian Montoya
christianmontoya.net


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] preserve whitespace

2007-12-11 Thread David Hucklesby
On Tue, 11 Dec 2007 16:09:03 +, Simon Cockayne wrote:
>
> I have an HTML page and I want to (well my client wants me to) preserve 
> leading blanks
> in the value of a table data cell. ...
>

 td {white-space: pre;} /* perhaps? */


Cordially,
David
--
www.hucklesby.com




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] preserve whitespace

2007-12-11 Thread Константин Ефимов
The "standard" way is to use paddings (if your HTML page really contains table 
data) or not to use tables for layout purpose at all.

-
Konstantin Efimov
http://webstandards.org.ru


  - Original Message - 
  From: Simon Cockayne 
  To: wsg@webstandardsgroup.org 
  Sent: Tuesday, December 11, 2007 8:09 PM
  Subject: [WSG] preserve whitespace


  Hi,

  
  I have an HTML page and I want to (well my client wants me to) preserve 
leading blanks in the value of a table data cell.
  I could use   around the data. 
  Or I could use an   for each leading blank.
  Any others?
  What is the "standard" way to do it?

  Cheers,

  Simon

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***


Re: [WSG] preserve whitespace

2007-12-11 Thread Patrick H. Lauke

Quoting Simon Cockayne <[EMAIL PROTECTED]>:


I have an HTML page and I want to (well my client wants me to) preserve
leading blanks in the value of a table data cell.


Depending on the data...right-align the text?

--
Patrick H. Lauke
__
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
__
Co-lead, Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
__
Take it to the streets ... join the WaSP Street Team
http://streetteam.webstandards.org/
__



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] preserve whitespace

2007-12-11 Thread Stepan Reznikov
td {text-indent: 1em;}


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] preserve whitespace

2007-12-11 Thread Max A. Shpack
Hi

It is non-schematic way and usually you can solve this problem with
css padding property. If you don't -- use   to keep whitespace.

Max.

2007/12/11, Simon Cockayne <[EMAIL PROTECTED]>:
> Hi,
>
> 
>
> I have an HTML page and I want to (well my client wants me to) preserve
> leading blanks in the value of a table data cell.
>
> I could use   around the data.
>
> Or I could use an   for each leading blank.
>
> Any others?
>
> What is the "standard" way to do it?
>
>
> Cheers,
>
> Simon
>
>
>
> ***
> List Guidelines:
> http://webstandardsgroup.org/mail/guidelines.cfm
> Unsubscribe:
> http://webstandardsgroup.org/join/unsubscribe.cfm
> Help: [EMAIL PROTECTED]
> ***


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



[WSG] preserve whitespace

2007-12-11 Thread Simon Cockayne
Hi,



I have an HTML page and I want to (well my client wants me to) preserve
leading blanks in the value of a table data cell.

I could use   around the data.

Or I could use an   for each leading blank.

Any others?

What is the "standard" way to do it?


Cheers,

Simon


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***