HTML Home
HTML Home
OME
troduction HTML Lists Best Web
et Started PHP MySQ
sic « Previous Next Chapter » Hosting
ements Top 10 W
tributes Hosting
eadings The most common HTML lists are ordered and unordered lists: UK Resell
ragraphs Hosting
rmatting Cloud Hos
yles HTML Lists Top Web
nks
mages An ordered list: An unordered list: $6.93 Dom
Extras
bles
sts 1. The first list item List item Cheap We
rms 2. The second list item List item Hosting
ames WEB BUI
ames 3. The third list item List item Download
lors Editor
lornames FREE Flas
lorvalues Try-It-Yourself Examples Website
uick List Free Web
Template
Unordered list
WordPres
How to create an unordered list in an HTML document.
ced Themes
octypes Ordered list W3SCH
SS How to create an ordered list in an HTML document. EXA
ead Get Certif
eta (You can find more examples at the bottom of this page). HTML, CS
ripts JavaScrip
tities PHP, and
RLs W3SCH
RL Encode HTML Unordered Lists BOO
ebserver New Book
mmary An unordered list starts with the <ul> tag. Each list item starts with the <li> HTML, CS
tag. JavaScrip
Ajax
ples The list items are marked with bullets (typically small black circles). STATIS
amples Browser
<ul> Statistics
uiz
<li>Coffee</li> Browser O
rtificate
<li>Milk</li> Browser D
</ul> SHAR
ences PAG
g List Share wit
tributes How the HTML code above looks in a browser:
ents
lornames Coffee
lorpicker Milk
haracter
SCII
O-8859-1 HTML Ordered Lists
mbols
RL Encode An ordered list starts with the <ol> tag. Each list item starts with the <li>
ng Codes tag.
atus Codes
The list items are marked with numbers.
se Version
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
1. Coffee
2. Milk
The <dl> tag is used in conjunction with <dt> (defines the item in the list)
and <dd> (describes the item in the list):
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
How the HTML code above looks in a browser:
Coffee
- black hot drink
Milk
- white cold drink
More Examples
Different types of ordered lists
Demonstrates different types of ordered lists.
Nested list
Demonstrates how you can nest lists.
Nested list 2
Demonstrates a more complicated nested list.
Definition list
Demonstrates a definition list.
XML development
Web & Web services development
Data mapping & integration
Rendering & publishing XML & database
data
XBRL validation, taxonomy editing,
transformation & rendering
Chart & report generation for XML & XBRL
The MissionKit for XML Developers includes
XMLSpy® - the industry-leading XML editor;
MapForce® - a graphical data mapping,
conversion, and integration tool; StyleVision® - a
visual XSLT stylesheet and report designer;
DiffDog® - an XML-aware diff/merge tool; and 2
additional tools.
Try all 6 products free for 30 days!
Your browser does not support inline frames or is currently configured not to
display inline frames.
ols is optimized for learning, testing, and training. Examples might be simplified to improve reading a
understanding.
s, references, and examples are constantly reviewed to avoid errors, but we cannot warrent full corre
all content.
While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright 1999-2011 by Refsnes Data. All Rights Reserved.
I went over tables briefly in my basic HTML tutorial, but since there
are so many attributes for them, I thought it'd be best to create a
separate HTML table tutorial that focuses solely on the various table
attributes.
Try the Auto Table Generator. It automatically builds your table for you based on the attributes you
specify.
Download now.
The <td> tag represents a cell (or column) inside the row.
<table>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>X</td>
<td>Y</td>
<td>Z</td>
</tr>
</table>
A BC
X Y Z
Notice that by looking at the code, you can tell how many rows and
columns are included just by looking at the code. The two opening
<tr> tags indicate two rows and the three opening <td> tags on each
line represents three data cells (or three columns).
So if you wanted to add another row, you would just start with another
<tr> and so forth....
<table border="2">
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>X</td>
<td>Y</td>
<td>Z</td>
</tr>
</table>
Notice the "2" represents the thickness of the border. If you had set it
to "0" then there would have been no border at all. If you wanted it
very thick then you could set it to 8, for example. So now your table
will look like this:
A BC
X Y Z
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>X</td>
<td>Y</td>
<td>Z</td>
</tr>
</table>
A BC
X Y Z
The cellspacing attribute adjusts the space between the cells and
cellpadding adjusts the space within (around) the cell.
A B C
X Y Z
If you want a table to have a single border (with no border around the
letters), simply set the cellspacing to "0" and your table will look like
this....
A BC
X YZ
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>X</td>
<td>Y</td>
<td>Z</td>
</tr>
</table>
Since the width is set to 100% that means the table will take up 100%
of the screen and the columns in the table will be adjusted evenly.
Here's what it would look like.
A B C
X Y Z
As we mentioned, you can also set the table width using pixels instead
of percentages. So instead of setting it to 100%, you could set it to
300 pixels:
</table>
A B C
X Y Z
<tr>
<td width="70%">A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td width="70%">X</td>
<td>Y</td>
<td>Z</td>
</tr>
</table>
A B C
X Y Z
See how the column width for the first column in both rows is set to
70%. Notice there is no value set for the other 2 columns. If you do
not set a value for the remaining columns, their width will
automatically be adjusted to take up the remaining space and they'll
share it equally.
Since the table width is set to 300 pixels, and the first column is
instructed to take up 70% of those 300 pixels (roughly 210 pixels), the
other 2 columns divide the remaining 30% of the table equally
(roughly 45 pixels a piece).
You could also have expressed the column widths of this table in pixels
instead of percentages. The code would have looked like this:
<tr>
<td width="210">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
<tr>
<td width="210">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
</table>
A B C
A B C
See how the width of the columns in each row add up to 300 (210 +
45 + 45) -- which is the width of the table.
Many people prefer to express their table width and column widths in
percentages because that will ensure that the table takes up the same
amount of screen no matter how big or small the screen resolution is.
If someone is using a 21 inch monitor to view your site and you have a
table width set to 300 pixels, the table will show up very small on their
screen. However if you set the table width to 70%, it will take up 70%
of the screen no matter what size monitor the person is using.
Or, let's say you create a table that is 760 pixels wide and someone
has a 15 inch monitor set to a 640x480 resolution, then that person
will have to scroll left and right just to see the entire table.
On the other hand, if you set the table width to 100%, the table will fit
the screen no matter what resolution the browser is set to.
So it's really up to you to decide what's the best layout for your tables.
Personally I prefer to use percentages. That way the table takes up
the same amount of screen no matter what size monitor/resolution
people are using.
<tr>
<td width="210">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
<tr>
<td width="210">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
</table>
A B C
A B C
<tr>
<td width="210" align="center">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
<tr>
<td width="210" align="center">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
</table>
A B C
A B C
See how the first column is aligned to the center? You can also right
align the columns by using the align="right" inside the <td> cells.
<tr>
<td valign="top" width="210">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
<tr>
<td valign="top" width="210">A</td>
<td width="45">B</td>
<td width="45">C</td>
</tr>
</table>
A B C
A B C
I've set the table height to "250" so the alignment would be more
noticeable. Notice that the A in both rows are aligned to the top. You
can also align to the "bottom" or the "middle".
<tr>
<td valign="top" width="25%">Left Nav Links Here</td>
<td valign="top" width="75%">Body Here</td>
</tr>
</table>
Notice I set the border to "0" but it's still showing in the example. I
just did that to show how the layout would look. If you set your border
to "0" you won't see any lines around your table.
HTML
Codes/
Generat
ors
HTML
HTML Marquee Code
Backgro Related:
und
• Scrolling Images
Code
• Marquee Generator
HTML
• Stop/Start Marquee
Bold • Slow Down Marquee
HTML • JavaScript Scroll
Color • Falling-Text Marquee
HTML
Color
You can create a scrolling marquee (i.e. scrolling text or scrolling images) by
Chart
using the <marquee> tag. You can make the text/images scroll from right to
HTML
left, left to right, top to bottom, or bottom to top - it's your choice!
Comme
nt Box
TIP: You can make it easy on yourself by using the marquee generator.
Code
HTML
Scrollbo
x Code
Example Marquee Code
HTML
Text Note that if you can't view the examples, it's likely that your browser doesn't
Code support the marquee tag.
HTML
Image
Code
Slide-in text:
HTML
Link This text slides in from the right, then stays where it is. You will need to refresh
Code this page to see the effect again.
HTML
Marque
e Code
HTML
Music
Code
HTML
Video
This code results in:
Code
HTML
Form
Code @ Your slide-in text g
HTML
Frames Continuous scrolling text:
Code
HTML
Entities
HTML
Exampl
es
HTML
Help/Ch
eat This code results in:
Sheet
HTML
Templat @ Your scrolling text g
es
More Text bouncing back and forth:
Codes..
.
HTML
Generat
or
HTML
Table
Generat
or
Marque
e
Generat
This code results in:
or
Music
Code
Generat
@ Your bouncing text g
or
HTML Text Scrolling Upwards:
Text
Generat
or
Text
Box
Generat
or
MySpac
This code results in:
e
Generat
ors
More
@ Your upward scrolling text g
Genera
tors... Change the Scrolling Speed:
HTML
Tags
HTML 5
Tags
Create
a
Website
@ Slow scro
@ Medium scro
@ Fast scro
Start your domain
Scrolling Images:
Simply replace the src="... part with the location of your own image.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
@ Marquee effects.
Also See...
Marquee Generator
HTML Color
HTML Codes
Web Reference
HTML Lists HTML Reference CSS Reference
There are 3 different types of lists. A <ol> tag starts Help Tizag Grow
an ordered list, <ul> for unordered lists, and <dl> for definition lists. Use t
Link to Tizag
<h4 align="center">Goals</h4>
<ol>
<li>Find a Job</li>
More Tutorials!
<li>Get Money</li> Microsoft Office Tutorials Artist Tutorials
<li>Move Out</li>
</ol>
HTML Unordered Lists
Create a bulleted list with the <ul> tag. The bullet itself comes in three flavors: squares, discs, and circles. The default bullet d
HTML Code:
<h4 align="center">Shopping List</h4>
<ul>
<li>Milk</li>
<li>Toilet Paper</li>
<li>Cereal</li>
<li>Bread</li>
</ul>
Unordered Lists:
Milk
Toilet Paper
Cereal
Bread
Here's a look at the other flavors of unordered lists may look like.
HTML Code:
<ul type="square">
<ul type="disc">
<ul type="circle">
Bread Bread o
HTML Code:
<dl>
<dt><b>Fromage</b></dt>
<dd>French word for cheese.</dd>
<dt><b>Voiture</b></dt>
<dd>French word for car.</dd>
</dt>
HTML Code:
Fromage
French word for cheese.
Voiture
French word for car.
Go Back
Continue
Tips
Use the start and type attributes to customize your lists.
It is possible to make lists of lists, which is helpful for creating some items, such as outlines.
Example of subscripts and superscripts. In each example the first "2" is a professionally
designed subscript included as part of the glyph set; the second "2" is a manual
approximation using a small version of the standard "2." Notice that the visual weight of
the first "2" matches the other letters better. (The top typeface is Adobe Garamond Pro;
the size of the subscript is about 62% of the original characters, dropped by about 16%.
The second typeface is Myriad Pro; the superscript is about 60% of the original
characters, raised by about 44%.)
Contents
[hide]
1 Uses
o 1.1 Subscripts that are dropped below the baseline
o 1.2 Subscripts that are aligned with the baseline
o 1.3 Superscripts that typically do not extend above the ascender line
o 1.4 Superscripts that typically extend above the ascender line
o 1.5 Alignment examples
2 Software support
o 2.1 Desktop publishing
3 Position adjustment in italic/oblique/slanted styles
o 3.1 HTML
o 3.2 TeX
o 3.3 Unicode
o 3.4 OpenType
4 See also
5 References
6 Bibliography
7 External links
[edit] Uses
The four common locations of subscripts and superscripts. The typeface is Myriad Pro.
Subscripted numbers dropped below the baseline are also used for the
denominators of stacked fractions, like this: .
Superscripts are used for the standard abbreviations for service mark
℠ and trademark ™. The signs for copyright © and registered
trademark ® are also sometimes superscripted, depending on the use
or the typeface.
Both low and high superscripts can be used to indicate the presence of
a footnote in a document, like this5 or this.xi Any combination of
characters can be used for this purpose; in technical writing footnotes
are sometimes composed of letters and numbers together, like this. A.2
The choice of low or high alignment depends on one’s taste, but high-
set footnotes tend to be more common, as they stand out more from
the text.
The charges of ions and subatomic particles are also denoted with
superscripts. Cl-
is a negatively charged chlorine atom, Pb4+
is an atom of lead with a charge of positive four, e−
is an electron, e+
is a positron, and μ+
is an antimuon.
1. Default subscript and superscript options can be overcome by manually changing the
font size and raising/lowering text.
HTML subscripts and superscripts
X6 O8M X6O8M
Default subscript and
superscript rendered in Example of possible collision
HTML for fonts in normal of italic styles in HTML.
styles.
But more generally, the same problem occurs as well between spans
of normal glyphs (non-subperscript and non-subscripts) when slanting
styles are mixed.
[edit] HTML
[edit] TeX
[edit] Unicode
Main article: Unicode subscripts and superscripts
the Latin-1 Supplement block contains the feminine and masculine ordinal
indicators ª and º, superscript numerals ¹, ², and ³, and the precomposed diagonal
fractions ½, ¼, and ¾. The copyright © and registered trademark signs ® are also
in this block.
the General Punctuation block contains the permille sign ‰ and the per-ten-
thousand sign ‱.
the Number Forms block contains several pre-composed diagonal fractions: ⅐
⅑⅒⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟↉
the Combining Diacritical Marks block contains medieval superscript letter
diacritics. These letters are written directly above other letters appearing in
medieval Germanic manuscripts, and so these glyphs do not include spacing, for
example uͤ. They are shown here over a long string of
periods: ....ͣ...ͤ...ͥ...ͦ...ͧ...ͨ...ͩ...ͪ...ͫ...ͬ...ͭ...ͮ...ͯ..
the Superscripts and Subscripts block contains superscripts of numbers,
mathematical symbols, and a few letters: ⁰ ⁱ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾ ⁿ ₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇
₈₉₊₋₌₍₎ₐₑₒₓₔ
the Letterlike Symbols block contains a few symbols composed of subscript and
superscript characters: ℀ ℁ ℅ ℆ № ℠ ™ ⅍
the Spacing Modifier Letters block has superscripted letters and symbols used for
phonetic transcription: ʰ ʱ ʲ ʳ ʴ ʵ ʶ ʷ ʸ ˀ ˁ ˠ ˡ ˢ ˣ ˤ
the Phonetic Extensions block has several sub- and super-scripted letters and
symbols: ᴬ ᴭ ᴮ ᴯ ᴰ ᴱ ᴲ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴻ ᴼ ᴽ ᴾ ᴿ ᵀ ᵁ ᵂ ᵃ ᵄ ᵅ ᵆ ᵇ ᵈ ᵉ ᵊ ᵋ ᵌ ᵍ ᵎ ᵏ ᵐ ᵑ ᵒ ᵓ ᵔ ᵕ ᵖ ᵗ ᵘ ᵙ ᵚ ᵛ ᵜ
ᵝᵞᵟᵠᵡᵢᵣᵤᵥᵦᵧᵨᵩᵪᵸ
the Phonetic Extensions Supplement block has a few more: ᶛ ᶜ ᶝ ᶞ ᶟ ᶠ ᶡ ᶢ ᶣ ᶤ ᶥ ᶦ ᶧ ᶨ ᶩ ᶪ ᶫ ᶬ
ᶭᶮᶯᶰᶱᶲᶳᶴᶵᶶᶷᶸᶹᶺᶻᶼᶽᶾᶿ
[edit] OpenType
[edit] References
1. ^ Bringhurst 2005, pp 311–12.
2. ^ Bringhurst 2005, p 309.
3. ^ http://www.english.cam.ac.uk/ceres/ehoc/conventions.html
4. ^ http://std.dkuug.dk/JTC1/SC2/WG2/docs/n2266.pdf
[edit] Bibliography
Bringhurst, Robert (2005), The Elements of Typographic Style, 3rd ed.,
Vancouver: Hartley and Marks, ISBN 0-88179-205-5.
[hide]v · d · eTypography