473,796 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

any guarantees how tabs in <PRE> will be rendered?

In wdg-html-reference/html40/block/pre.html there is no mention about
how ASCII tabs (^I) are to be rendered. I suppose all bets are off?

Wait, my docs go thru html-tidy first, and it says
tab-size: number
Sets the number of columns between successive tab stops. The
default is 4. It is used to map tabs to spaces when reading
files. Tidy never outputs files with tabs.

However, in emacs, tab-width's value is 8. Solution:
$ echo tab-size: 8 >> ~/.tidyrc

Is 4 more common than 8? Why would tidy pick 4?
Jul 20 '05 #1
1 3434
Dan Jacobson <ji*****@jidann i.org> wrote:
In wdg-html-reference/html40/block/pre.html
You presumably mean
http://www.htmlhelp.com/reference/html40/block/pre.html
there is no mention about
how ASCII tabs (^I) are to be rendered. I suppose all bets are off?
If you check the specification (using e.g. links at the bottom of that
page), you will see that there is a definition on how tabs should be
dealt with in <pre> content _and_ a remark that you should not rely on
that since browser behavior varies. Well, the HTML 4 wording has
actually even removed the _definition_ and replaced it with a
_description_:
"The horizontal tab character (decimal 9 in [ISO10646] and [ISO88591] )
is usually interpreted by visual user agents as the smallest non-zero
number of spaces necessary to line characters up along tab stops that
are every 8 characters. We strongly discourage using horizontal tabs in
preformatted text since it is common practice, when editing, to set the
tab-spacing to other values, leading to misaligned documents."
Source: http://www.w3.org/TR/html4/struct/text.html#edef-PRE
Wait, my docs go thru html-tidy first, and it says
tab-size: number
Sets the number of columns between successive tab stops. The
default is 4. It is used to map tabs to spaces when reading
files. Tidy never outputs files with tabs.


That's rather illogical, though understandable (since in many contexts
outside HTML, such tab stop settings are common). It means that a valid
HTML document (the use of tabs is valid, though not recommended) will
be converted to a document with a different meaning as per the old
specifications, since in <pre> content the amount of white space is
significant.

But why would this matter, in HTML authoring for the WWW? If your data
is tabular, you should probably not use <pre> at all but <table>.
And if you have existing data with tabs, and for some reason you are
not going to convert it to table format, then you should run a
conversion that replaces tabs by spaces _as adequate for the data_.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
10947
by: Wladimir Borsov | last post by:
Assume I want to publish a longer article on a web page. One of the paragraphs I want to display with an indent. Read: All text lines of this paragraph should be displayed with (let's say 8) blanks from the "normal" left side. How do I do that without coding "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" ? Is there something like <TAB size=8> ..... </TAB> ?
21
10226
by: Headless | last post by:
I've marked up song lyrics with the <pre> tag because it seems the most appropriate type of markup for the type of data. This results in inefficient use of horizontal space due to UA's default rendering of <pre> in a fixed width font. To change that I'd have to specify a proportional font family, thereby falling into the size pitfall that is associated with any sort of author specified font family: a) If I specify a sans serif font...
3
8652
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample text</TD> <TD> not predefined font</TD></TR></TABLE>
1
1802
by: Alan Illeman | last post by:
This is one of several macros I wish to display: <PRE CLASS="special macro> ;; ;; Reverse argument list ;; reverse_args MACRO arglist:req local txt, arg txt textequ <> % FOR arg, <arglist>
3
12927
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will preserve formatting (white space and line feeds). However, this is not true when doing the same with the <code> tag listing (it will all be pasted on one line with multiple successive spaces treated as a single space) despite the fact that...
7
2753
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
9
5551
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
14
3633
by: Schraalhans Keukenmeester | last post by:
I am building a default sheet for my linux-related pages. Since many linux users still rely on/prefer viewing textmode and unstyled content I try to stick to the correct html tags to pertain good readibility on browsers w/o css-support. For important notes, warnings etc I use the <pre> tag, which shows in a neat bordered box when viewed with css, and depending on its class a clarifying background-image is shown. I would like the...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.