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 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.Harry S. Dukes and William H. Clayton, Tabulating mechanism for type-writing machines, , granted Dec. 29, 1908.
Initially tab stops were set by adding and removing clips from the tab rack, but Edward Hess working for the Royal Typewriter Company 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.Edward B. Hess, Writing Machine, , granted Aug. 17. 1909. 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.James F. Koca, Typewriter stop mechanism, , granted Sep. 19, 1944. These keys, if present, are typically labeled tab set and tab clear.
When filling out a computerized form, pressing Tab will move the cursor to the next Text 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 GUI 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 macOS, 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.
In 'PC' video games, 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 (or any other useful info).
A vertical tab (VT) also exists and has ASCII decimal character code 11 ( or ^K), escape character \v.
In EBCDIC the code for HT is 5, and 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.
The intention was to have the printers be programmed with 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. 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 five characters being ½" and the typical paragraph indentation at that time, the horizontal tab size of 8 evolved because as a power of two it was easier to calculate with the limited digital electronics available. Vertical tab was rarely supported on these terminals.
In contrast to the de facto 8 character standard, some IDEs use a default horizontal tab size of 4 characters.
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 debate regarding the use of tabs and spaces for code alignment called elastic tabstopshttp://nickgravgaard.com/elastic-tabstops/. This idea uses a scheme called tab-separated columns (TSC) rather than the similar tab-separated values (TSV).
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. 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.
The vertical tab is &#xB; but is not allowed in SGML; this includes XML 1.0Extensible Markup Language W3C Recommendation (5th Edition). http://www.w3.org/TR/xml/#charsets and HTML.
The tab characters can be graphically represented by Control Pictures: