Tab key

Tab key on a standard keyboard (on upper left)

Tab Tab key (abbreviation of tabulator key[1] or tabular key[2]) on a keyboard is used to advance the cursor to the next tab stop.

History

The word tab derives from the word tabulate, which means "to arrange data in a tabular, or table, form." When a person wanted to type a table (of numbers or text) on a typewriter, there was a lot of time-consuming and repetitive use of the space bar and backspace key. To simplify this, a horizontal bar was placed in the mechanism with a moveable lever stop for every position across the page, called a tab stop. Initially these were set by hand, but later tab set and tab clear keys were added. When the tab key was depressed, the carriage advanced to the next tab stop. These were set to correspond to the particular column locations of the table, hence tab, being worked on.

The tab mechanism also came into its own as a rapid and consistent way of uniformly indenting the first line of each paragraph, often a first tab stop at 5 or 6 characters was used for this, far larger than the indentation used when typesetting.

Modern usage

In word processing and text editing the Tab key will often move the insertion point to the next tab stop in a table, or may insert the ASCII tab character or many space characters.

When filling out a computerized form, pressing Tab will move the cursor to the next field (and Shift-Tab will move the cursor to the previous field), eliminating the need to use a mouse to click in an adjacent field.

In many graphical applications, especially on Windows, the Tab key will move the focus to every control or widget such as buttons so that the user interface can be used without a mouse at all (this was part of the IBM Common User Access design). On OS X, this is an option called "Full Keyboard Access".

Tab may be used to complete a partially typed piece of text. For example, in some command-line interfaces, you may type the first few characters of a command or file-name, then press Tab. If there is no ambiguity about your intent, the rest of the characters will appear automatically. This usage is more common on Unix than Windows.

Tab characters

The most known and common tab is a horizontal tab (HT), which in ASCII has the decimal character code of 9, and may be referred to as Ctrl+I or ^I. In C and many other programming languages the escape code \t can be used to put this character into a string constant. The horizontal tab is usually generated by the Tab key on a standard keyboard.

A vertical tab (VT) also exists and has ASCII decimal character code 11 (Ctrl+K or ^K), escape character \v.

In EBCDIC the code for HT is 5, and VT is 11 (the same as in ASCII).

Originally, printer mechanisms used mechanical tab stops to indicate where the tabs went. This was done horizontally with movable metal prongs in a row, and vertically with a loop of mylar or other tape the length of a page with holes punched in it to indicate the tab stops. Initially these were manually set up to match the preprinted forms that were loaded into the printer. Later, the intention was to have the machine be pre-programmed, by using other control characters to set and clear the stops: ISO 6429 includes the codes 136 (Horizontal Tabulation Set), 137 (Horizontal Tabulation with Justification) and 138 (Vertical Tabulation Set).

In practice, settable tab stops were rather quickly replaced with fixed tab stops, de facto standardized at every multiple of 8 characters horizontally, and every 6 lines vertically (typically one inch vertically). A printing program could easily send the necessary spaces or line feeds to move to any position wanted on a form, and this was far more reliable than the modal and non-standard methods of setting tab stops. Tab characters simply became a form of data compression.

A common horizontal tab size of eight characters evolved, despite five characters being half an inch and the typical paragraph indentation of the time, because as a power of two it was easier to calculate in binary for the limited digital electronics available.

Tab-separated values (TSV)

Tab-separated values (TSV) are a common de facto standard for exporting and importing database or spreadsheet field values. Text divided into fields delimited by tabs can often be pasted into a word processor and formatted into a table with a single command. For example, in Microsoft Word 2010, Insert > Table > Convert Text to Table... is the necessary command, producing a dialog where the user selects further details.

The TSV convention for exporting data may be compared to the alternative comma-separated values (CSV) convention.

Gopher menus use tab-separated values to indicate selectors.

TSV has also been cited in a modern approach to solving the programming fundamentalist debate regarding the use of tabs and spaces for code alignment called Elastic tabstops.[3] Arguments have been made to replace the antiquated vertical tabs with columnar alignment in source code editors.

HTML

HTML represents the horizontal tab as &#9; and &Tab;,[4][5] but as with all whitespace characters in HTML, this will be displayed as a single space except inside <pre> tags or other elements with CSS attribute white-space set to pre.

Here is an example showing the use of &#9; in HTML using <pre></pre> tags:

These 2 lines are tabbed:
2009&#9;This line uses a tab.
&#9;This line also uses a tab.
This line does not use a tab.

The result would be something like this:

These 2 lines are tabbed:
2009	This line uses a tab.
	This line also uses a tab.
This line does not use a tab.

The vertical tab is &#xB; but is not allowed in SGML; this includes XML 1.0[6] and HTML. In CSS, tabs are preserved in an element as shown above if the attribute white-space set to pre. CSS 3 defines tab-size property, which adjusts the number of spaces for the tab character from the default of 8.[7] The latest version of WebKit supports the tab-size property. The Opera web browser supports the -o-tab-size CSS property, the Firefox web browser supports the -moz-tab-size CSS property with the same meaning.[8]

Unicode

The Unicode code points for the (horizontal) tab character, and the more rarely used vertical tab character are copied from ASCII:[9]

The tab characters can be graphically represented by special symbols:

Unicode also has characters for the symbols to represent or be printed on the tab key:[10]

See also

References

  1. "Underwood Portable Typewriter Gallery". Retrieved 2011-04-09.
  2. "Instructions for Using the Underwood Typewriter" (PDF). Retrieved 2011-04-09.
  3. http://nickgravgaard.com/elastic-tabstops/
  4. See Character encodings in HTML#HTML character references
  5. http://dev.w3.org/html5/html-author/charref
  6. Extensible Markup Language W3C Recommendation (5th Edition). http://www.w3.org/TR/xml/#charsets
  7. "CSS 3 tab-size property W3 specification".
  8. "CSS tab-size property on Mozilla Developer Network".
  9. "C0 Controls and Basic Latin" (PDF). Retrieved 2013-12-13.
  10. "Arrows – Unicode" (PDF). Retrieved 2013-12-13.

External links

This article is issued from Wikipedia - version of the Saturday, February 13, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.