ArticleslgStudy

science

Tab character

Tab character is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Tab character rather than just read about it. In short: A tab character is a control character that encodes alignment instructions in text. Unlike a printable character, it does not represent content like a letter or a digit.

Key takeaways

  • Tab character belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Tab character to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Tab character from memory before moving on to harder problems.

Reference excerpt

A tab character is a control character that encodes alignment instructions in text. Unlike a printable character, it does not represent content like a letter or a digit. Although multiple tab characters have been defined and used in the past, today the variation that is widely used is the horizontal tab (HT). The vertical tab (VT) and other more esoteric alignment control characters were used in the past and remain defined in modern character encodings although rarely used.

Use

Programming The use of tabs is common for aligning blocks of source code although spaces are a common alternative. Tabs have some benefits over spaces when used for alignment. With tabs, a single backspace removes an entire indentation level; which not all editors support for space-based indentation, which typically uses multiple spaces for each indentation level. The displayed width of a tab can be changed in the settings menu of almost every editor. The most common approach is to use tabs for indentation levels and spaces for alignment as code is typically viewed with a monospaced font. A text editor feature called elastic tabstops makes tabs useful for alignment too by adjusting the width of each individual tab in a text using an algorithm and solves alignment issues that otherwise occur when programming with proportional fonts. 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 adjusting tab stop size based on the style of pre-existing file content.

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. 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.

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.

Representation

ASCII In ASCII, the code has value 9. Since ASCII values were originally typed by holding the Control key and pressing a letter key on a typewriter-style terminal, the tab character is sometimes written as Ctrl +I or ^I.

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

String literal escape syntax In many programming languages, the escape sequence \t represents the tab character in a string literal.

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

U+0009 <control-0009> (CHARACTER TABULATION, horizontal tabulation (HT), tab) U+000B <control-000B> (LINE TABULATION, vertical tabulation (VT)) The tab characters can be graphically represented by special symbols:

U+2409 ␉ SYMBOL FOR HORIZONTAL TABULATION U+240B ␋ SYMBOL FOR VERTICAL TABULATION Unicode also has characters for the symbols to represent or be printed on the tab key:

U+21B9 ↹ LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR (tab with shift tab) U+21C6 ⇆ LEFTWARDS ARROW OVER RIGHTWARDS ARROW U+21E4 ⇤ LEFTWARDS ARROW TO BAR (leftward tab) U+21E5 ⇥ RIGHTWARDS ARROW TO BAR (rightward tab) Unicode provides additional characters for tab symbols with triangle-headed arrow:

U+2B70 ⭰ LEFTWARDS TRIANGLE-HEADED ARROW TO BAR (left tab) U+2B71 ⭱ UPWARDS TRIANGLE-HEADED ARROW TO BAR (up tab) U+2B72 ⭲ RIGHTWARDS TRIANGLE-HEADED ARROW TO BAR (right tab) U+2B73 ⭳ DOWNWARDS TRIANGLE-HEADED ARROW TO BAR (down tab) U+2B7E ⭾ HORIZONTAL TAB KEY U+2B7F ⭿ VERTICAL TAB KEY

HTML In HTML the horizontal tab is coded using &#9; or &Tab; but as with all whitespace characters in HTML, this will be displayed as a single space except inside <pre>, <code> tags (or other elements with CSS attribute white-space set to pre). Here is an example:

HTML

Inside <pre>

This line begins with a single tab. Here are some more tab characters ! T.......T.......T.......T.......T.......T.......T.......T

Outside <pre>

Notice that the tab at the start of a line is removed outside <pre>, the eight-character spacing, and how a tab stop is skipped if there are more than eight characters since last one. CSS3 defines tab-size property, which adjusts the number of spaces for the tab character from the default of eight. 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.0 and HTML.

See also Comma-separated values – Text format

References

Worked examples

Example 1 — a first encounter with Tab character

Start with the simplest possible case. Write down what Tab character claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Tab character before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Tab character ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Tab character

In research
Tab character appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Tab character in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Tab character is common in secondary-school and first-year university syllabi. It links to neighbouring topics Control characters, so understanding it makes those chapters shorter.
In everyday life
Look for Tab character outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Tab character” →

How to study Tab character in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Tab character means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Tab character out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Tab character in simple terms?

A tab character is a control character that encodes alignment instructions in text. Unlike a printable character, it does not represent content like a letter or a digit.

Why does Tab character matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Tab character?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Tab character.

Tags

  • Control characters

Keep exploring