Printing 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. In this sense, a tab character provides for data compression, specifying multiple spaces or lines with a single character.
Text formatting The tab character is often used in text to align the left-side of content vertically and in particular to indent paragraphs and lines by an equal amount. In a
text editor a (horizontal) tab may be inserted into the content when the
tab key is pressed although often the editor can be set up to insert spaces instead of a tab. A
word processor supports indentation and tabular formatting, but may or may not use the tab character to encode the formatting. The use of tabs is common for
aligning blocks of
source code although spaces are a common alternative. Despite the fact that five characters were the typical paragraph indentation on typewriters, 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 often use heuristics to adapt to the existing content of a file, inserting tabs or spaces and using tab stop size based on the style of the file content.
Tab-separated values The
tab-separated values (TSV) data format is often used for exporting and importing tabular data such a
database or
spreadsheet. Some
word processors format pasted TSV data as a table without requiring the user to indicate that they want a table.
Gopher menus use TSV to indicate selectors. TSV has been cited as 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). ==Representation==