HOME

TheInfoList



OR:

The tab key (abbreviation of tabulator key or tabular key) on a
keyboard Keyboard may refer to: Text input * Keyboard, part of a typewriter * Computer keyboard ** Keyboard layout, the software control of computer keyboards and their mapping ** Keyboard technology, computer keyboard hardware and firmware Music * Mu ...
is used to advance the cursor to the next
tab stop A tab stop on a typewriter is a location where the carriage movement is halted by an adjustable end stop. Tab stops are set manually, and pressing the tab key causes the carriage to go to the next tab stop. In text editors on a computer, the s ...
.


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 A typewriter is a mechanical or electromechanical machine for typing characters. Typically, a typewriter has an array of keys, and each one causes a different single character to be produced on paper by striking an inked ribbon selectivel ...
, there was a lot of time-consuming and repetitive use of the space bar and
backspace Backspace () is the keyboard key that originally pushed the typewriter carriage one position backwards and in modern computer systems moves the display cursor one position backwards,"Backwards" means to the left for left-to-right languages. delete ...
key. To simplify this, a horizontal bar was placed in the mechanism called the tabulator rack. Pressing the tab key would advance the carriage to the next tabulator stop. The original tabulator stops were adjustable clips that could be arranged by the user on the tabulator rack. Fredric Hillard filed a patent application for such a mechanism in 1900. The tab mechanism 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. For numeric data, however, the logical place for the tab stop is the location of the least significant digit. Tabbing to this location and then pressing the
backspace Backspace () is the keyboard key that originally pushed the typewriter carriage one position backwards and in modern computer systems moves the display cursor one position backwards,"Backwards" means to the left for left-to-right languages. delete ...
key to back up to the position of the first digit is practical but slow. Various schemes for numeric tabs were proposed. For example, in 1903, Harry Dukes and William Clayton filed for a patent on a tab mechanism with multiple tab keys numbered 1, 10, 100, etc. Pressing 1 was a simple tab. Pressing 10 advanced to the space before the tab, pressing 100 advanced to the position 2 spaces before the tab. Initially tab stops were set by adding and removing clips from the tab rack, but Edward Hess working for the
Royal Typewriter Company The Royal Typewriter Company is a manufacturer of typewriters founded in January 1904. It was headquartered in New York City with its factory in Hartford, Connecticut. History The Royal Typewriter Company was founded by Edward B. Hess and Lew ...
filed for a patent in 1904 covering a system where the tab stops were permanently mounted on the tab bar. To set or reset a tab for a particular column, the tab stop for that column was simply rotated in or out of engagement. In 1940, James Koca filed for a patent on a mechanism allowing the tab stops for each column to be set and cleared from the keyboard, eliminating the need for the typist to bend over the back of the machine to directly manipulate the tab rack. These keys, if present, are typically labeled tab set and tab clear.


Modern usage

In word processing and
text editing A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be u ...
, the Tab key will move the insertion point to the next tab stop in a table, insert the ASCII tab character, or insert multiple space characters (depending on the program used). When filling out a computerized form, pressing Tab will sometimes 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 Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for se ...
, 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 Common User Access (CUA) is a standard for user interfaces to operating systems and computer programs. It was developed by IBM and first published in 1987 as part of their Systems Application Architecture. Used originally in the MVS/ESA, VM/ ...
design). On
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and la ...
, this is an option called "Full Keyboard Access". A feature called tab completion can be used to complete a partially typed piece of text. For example, in some
command-line interface A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
s, 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. On some systems, even if your input is ambiguous, tab completion may give you a list of possible options to select from. Tab completion is more common on
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
,
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
, and
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems than
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for se ...
. In PC
video game Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, controller, keyboard, or motion sensing device to generate visual feedback. This feedba ...
s, the Tab key is very often used to show scores in multiplayer games. For single player games it is also used to show the world map or the player's inventory, as well as other useful info. In
software engineering Software engineering is a systematic engineering approach to software development. A software engineer is a person who applies the principles of software engineering to design, develop, maintain, test, and evaluate computer software. The term '' ...
, when developing computer programs or storing and manipulating data in files, the Tab character is often used for indentation purposes to help guide the flow of reading and add semantic structure to the code or data. Some programmers and programming languages prefer the usage of multiple whitespace characters instead for that purpose. Because of this, many text editors have an option that makes the tab key insert the number of whitespace characters that a tab character is set to be equivalent to (by default mostly four).


Tab characters

The most known and common tab is a ''horizontal tabulation'' (HT) or ''character tabulation'', which in
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
has the decimal character code of 9, and may be referred to as or . In C and many other
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s the escape sequence can be used to put this character into a string literal. The horizontal tab is usually inserted when the Tab key on a standard keyboard is pressed. A ''vertical tabulation'' (VT) also exists and has ASCII decimal character code 11 ( or ), escape character . In EBCDIC the code for HT is 5. VT is 11 (coincidentally 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. These were manually set to match the pre-printed forms that were loaded into the printer. In practice, settable tab stops were rather quickly replaced with fixed tab stops, ''de facto'' standardized at every multiple of eight characters horizontally, and every six lines vertically. A printing program could send zero or more tabs to get to the closest tab stop above and left of where it wanted to print, then send line feeds and spaces to get to the final location. Tab characters simply became a form of data compression. Despite the fact that five characters were the typical paragraph indentation on typewriters at that time, the horizontal tab size of eight evolved because as a power of two it was easier to calculate with the limited digital electronics available. Using this size tab to indent code results in much white space on the left, so most text editors for code, such as IDEs, allow the size of the tab to be changed, and some (in particular on Windows) default to four instead of eight. Disagreements between programmers about what size tabs are correct, and whether to use tabs at all, are common. Modern text editors usually have the Tab key insert the user-defined indentation and may use heuristics to adapt this behavior to existing files. ISO 6429 includes the codes 136 (Horizontal Tabulation Set), 137 (Horizontal Tabulation with Justification) and 138 (Vertical Tabulation Set) that were intended to allow the program to set and clear tab stops. This is rarely used or supported.


Tab-separated values

Tab-separated values A tab-separated values (TSV) file is a simple text format for storing data in a tabular structure, e.g., a database table or spreadsheet data, and a way of exchanging information between databases. Each record in the table is one line of the t ...
(TSV) are used for exporting and importing database or spreadsheet field values. Text divided into fields delimited by tabs can often be pasted into a
word processor A word processor (WP) is a device or computer program that provides for input, editing, formatting, and output of text, often with some additional features. Early word processors were stand-alone devices dedicated to the function, but current ...
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 A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separ ...
(CSV) convention (that may be using semicolons instead of commas), and both are easily converted into each other. Gopher menus use tab-separated values to indicate selectors. TSV has also been cited in a modern approach to solving the programming debate regarding the use of tabs and spaces for code alignment called elastic tabstops. This idea uses a scheme called tab-separated columns (TSC) rather than the similar tab-separated values (TSV).


HTML

In
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaS ...
the horizontal tab is coded using or but as with all whitespace characters in HTML, this will be displayed as a single space except inside , tags (or other elements with
CSS Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone technolo ...
attribute set to ). Here is an example:
;HTML: This line begins with a single tab. Here are some more tab characters ! T.......T.......T.......T.......T.......T.......T.......T ;Inside :
	This line begins with a single tab.
Here	are	some	more	tab	characters	!
T.......T.......T.......T.......T.......T.......T.......T
;Outside :
This line begins with a single tab. Here are some more tab characters ! T.......T.......T.......T.......T.......T.......T.......T
Notice that the tab at the start of a line is removed outside , the eight-character spacing, and how a tab stop is skipped if there are more than eight characters since last one. CSS3 defines property, which adjusts the number of spaces for the tab character from the default of eight. The latest version of
WebKit WebKit is a browser engine developed by Apple and primarily used in its Safari web browser, as well as on the iOS and iPadOS version of any web browser. WebKit is also used by the BlackBerry Browser, PlayStation consoles beginning from the ...
supports the property. The
Opera Opera is a form of theatre in which music is a fundamental component and dramatic roles are taken by singers. Such a "work" (the literal translation of the Italian word "opera") is typically a collaboration between a composer and a libr ...
web browser supports the CSS property, the Firefox web browser supports the CSS property with the same meaning. The vertical tab is but is not allowed in
SGML The Standard Generalized Markup Language (SGML; ISO 8879:1986) is a standard for defining generalized markup languages for documents. ISO 8879 Annex A.1 states that generalized markup is "based on two postulates": * Declarative: Markup should ...
; this includes
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
1.0 and HTML.


Unicode

The
Unicode Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, ...
code points for the (horizontal) tab character, and the more rarely used vertical tab character are copied from
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
: * (CHARACTER TABULATION, horizontal tabulation (HT), tab) * (LINE TABULATION, vertical tabulation (VT)) 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: * (tab with shift tab) * * (leftward tab) * (rightward tab)


See also

*
Comma-separated values A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separ ...
(CSV) *
Indentation style In computer programming, an indentation style is a convention governing the indentation of blocks of code to convey program structure. This article largely addresses the free-form languages, such as C and its descendants, but can be (and often ...


References

{{keyboard keys Computer keys Control characters Whitespace