Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Web Analytics
Cookie Policy Terms and Conditions Tab key - Wikipedia, the free encyclopedia

Tab key

From Wikipedia, the free encyclopedia

The tab key on a modern Linux keyboard (top left of picture)
The tab key on a modern Linux keyboard (top left of picture)

The tab key on a keyboard is used to advance the cursor to the next "tab stop".

Contents

[edit] Origin

Tab is the abbreviation of Tabulator. To tabulate (tabulating) means putting something into a table or chart.

When a typist wanted to type a table, there was a lot of time-consuming and repetitive use of the space bar and backspace key. To simplify this, a bar was placed in the mechanism with a moveable lever for every position across the page. Initially these were set by hand, but later a "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.

[edit] ASCII and EBCDIC

Several tab characters are included as ASCII control characters, used for text alignment. The most known and common tab is a horizontal tab (HT), which in ASCII has the decimal character code of 9. Though commonly perceived by the programming community to be a form of witchcraft, a vertical tab (VT) does exist and has ASCII decimal character code 11. (The EBCDIC code for HT is 5. The VT is 11, or hex 0B, the same as ASCII.) The horizontal tab is usually generated by the tab key on a standard keyboard.

Originally printers 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 to match the preprinted forms the printer was going to print. The intention was to have the machine be programmed with other control characters to set/clear the stops, but it is unclear if any popular printers implemented this. Instead it was rather quickly replaced with fixed tab stops, at every multiple of 8 characters horizontally and every 6 lines vertically, so they simply became a form of data compression, since a printing program could easily add the necessary spaces to move to any position wanted on a form. The vertical size was chosen to be 1 inch. It is unclear why the 8-character horizontal size was chosen, as 5 characters (1/2 inch in a typical printer at that time) was much more popular at that time as a paragraph indentation. It may have been chosen to match early Fortran conventions for where the statement text started after the line number and continuation character. Or it may have been chosen as the smallest size that would fit numbers typically printed in a table.

ISO 8859 also includes the codes 136 HTS Horizontal Tabulation Set, 137 HTJ Horizontal Tabulation with Justification and 138 VTS Vertical Tabulation Set.

Tabs are almost always rendered as a form of whitespace larger than a single space, while some text editors mark tabs with special graphics to facilitate distinguishing tabs and whitespaces. In word processor applications, the tab key typically moves the cursor to the next tab stop. In most other graphical applications, the tab key will shift the focus to the next control or widget.

A UNIX program, expand expands a tab to a number of spaces and unexpand does the opposite.

Text divided into fields delimited by tabs can be pasted into a word processor and formatted into a table with a single command.

[edit] Tabs in HTML

HTML represents the horizontal tab as &#09; but as with all whitespace characters this doesn't allow actual insertion of tabs into the page except inside <pre> tags.

Here is an example showing the use of &#09; with <pre> tags. If you write in HTML:

<pre>
These 2 lines are tabbed:
2005 &#09; This line uses a Tab space.
&#09; This line also uses a Tab space.

This line doesn't use a Tab space.
</pre>

the result would be something like this:

These 2 lines are tabbed:
2005     This line uses a Tab space.
         This line also uses a Tab space.

This line doesn't use a Tab space.

The vertical tab is &#11; but is not allowed in SGML (including HTML) or XML 1.0.

The issue is of concern in the use of Cascading Style Sheets, which asserts that in an element where white space is to be preserved:

... 2. All tabs (U+0009) are rendered as a horizontal shift that lines up the start edge of the next glyph with the next tab stop. Tab stops occur at points that are mutiples of 8 times the width of a space (U+0020) rendered in the block's font from the block's starting content edge.


[edit] Tabs in programming

In computer programming, the use of tabs for code formatting and indentation is an ongoing debate. The vast majority of code is written as plain ASCII, lacking the extra formatting information more elaborate markups and proprietary file formats provide. Some programmers consider the use of 8 spaces per tab to be excessive, such as when viewing very deeply nested (and therefore very deeply indented) lines of code. Others then point out that deeply indented code is to be considered a bad thing in itself.

Programmer's editors usually default to having the TAB key generate hard tabs, that is actual HT characters, but some editors expand them to space (SP) characters instead, often referred to as soft tabs. Good editors can be configured to perform either.

There are many arguments for and against using hard tabs in code. The most incompatability and conversion fun ensues when the tab key generates HT characters and the editor is configured for tab stops spaced anything but the de-facto every 8 characters. Interesting possibilities include 4, 2, and even 3. Then inevitably some lines will be formatted with spaces, others with tabs, or even both. As soon as the code ends up on someone else's screen it will look different and usually jumbled and untidy.

One early benefit of tabs, i.e. compression (see above), has become considered less relevant as desktop storage is seen as cheap, and sophisticated compression algorithms can provide much greater benefits, albeit at the cost of greater complexity.

[edit] Tabs in terminals

In many terminals pressing the tab key results in tab completion, or auto-completion of the command line.

In some IRC programs, tab finishes a username.

[edit] Trivia

In the "King-Size Homer" episode of The Simpsons, Homer Simpson uses a computer and looks for an "any key" but finds and presses the Tab since there is the sugar-free soda by the same name.

[edit] External links

Static Wikipedia 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu