Multiple Columns - HTML

As covered in Chapter , you can use tables to position elements in columns. This technique can be used for a variety of layout purposes:

  • Providing navigation bars to the right or left of text
  • Putting text into columns
  • More precise positioning controls, putting text next to graphics, and so on Columnar formatting is simple to accomplish, as shown in the following code:

A simple two-column format.

A simple two-column format.

Note: One caveat to creating columns with tables is that the content doesn’t automatically wrap from one column to the next (like in a newspaper). You must split the text between the columns manually.

Of course, the columns do not have to be the same size nor proportional to each other. You can define the columns in any size you need by using the appropriate formatting attributes. For example, if you wanted a navigation column to the left that is 200 pixels wide and a text column to the right that is 400 pixels wide, you could use this column definition:


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Topics