Advanced HTML Tags

Unordered Lists

Ordered Lists

The ol tag can also have a type attribute. The type attribute can be one of the following values

  • 1 This will cause the list to be numbered with numbers
  • A This will cause the list to be ordered with upper case letters
  • a This will cause the list to be ordered with lower case letters
  • I This will cause the list to be ordered with upper case roman numerals
  • i This will cause the list to be ordered with lower case roman numerals

Try it yourself.

Description Lists

Nesting Lists

Lists can be inside of other lists. Too. This is very much true of most HTML tags.

Tables

Tables have many uses, you can use them for organizing data as you normally would in a report where you have rows and columns of numbers or other information, but you can also use tables invisibly to influence how your page is displayed. In the early days of html it was common to use a table to create a two column page layout. We can still do that but now it is much more acceptable to use CSS for that purpose.

Here is a complete example that illustrates the use of the following table specific tags

  • table – This is the main tag for a table
  • tr – every row in a table starts with a tr tag
  • td – every column in a row is delineated by a td tag
  • th – You can use the th tag in place of the td tag in the first row to make headings

There are many attributes you can use with the various table tags.

  • table * width - you can specify a width as a percentage or as a number of pixels. This attribute is useful for right now, but its use is not encouraged, as you are better off to use CSS to control the look of your table. We say that this attribute is deprecated * border - you can add borders to your tables as in the example above, but this tag is deprecated as well. * The spacing between the cells of the table. Also deprecated.
  • td * colspan – if you have a particular table where you need an extra wide column in some rows you can make a cell of your table span more than one column using the colspan attribute. Its value is the number of columns.
  • tr * rowspan – If you have a particular table where you need an column to span multiple rows you can make a cell of your table span more than one row using the rowspan attribute. Its value is the number of rows.

Experiment with a table. What kinds of tags can you include inside each td? Can you make a table inside another table?

Audio

Embedding audio in your webpage allows you to link to various files containing music or speech. The audio tag looks like the following:

<audio controls>
    <source src="horse.ogg" type="audio/ogg">
    <source src="horse.mp3" type="audio/mpeg">
    Your browser does not support the audio element.
</audio>

The controls attribute provides start/stop/fast-forward/rewind buttons for the listener. The source tags inside the audio tag allow you to provide several different audio formats. This is because different browsers support different kinds of audio The browser will go through the list, in order, until it finds a format it understands, or else, it will replace the controller with the message at the end.

Video

Embedding video in your webpage allows you to link to various files containing movies.

<video height=312 width= 540 controls>
    <source src="movie.mp4" type="video/mp4">
    <source src="movie.ogg" type="video/ogg">
    Your browser does not support the video element.
</video>

The controls attribute provides start/stop/fast-forward/rewind buttons for the listener. The source tags inside the video tag allow you to provide several different video formats. This is because different browsers support different kinds of video The browser will go through the list, in order, until it finds a format it understands, or else, it will replace the controller with the message at the end.

IFrames

IFrames allow you to embed a webpage within another webpage. The activecode examples in this book use an iframe to allow you to experiment with the html, by creating a page within a page.

Next Section - Semantic HTML Tags