CSCI 351: Internet Programming

Creating a text table

The simplest way to create a table is to use fixed width fonts. However, just using the <tt> tag is not enough because new lines of text in HTML script won't correspond to new lines in the browser window. To solve this problem put your table between <pre> and </pre> tags and align the columns by using spaces. You should avoid using the tab key because the tabular positions may differ from one system to another.

Layout
            Computer models

Manufacturer          Model        Price
=========================================
City Computers        P325 Plus    $2500
Midwest CPU           586/Ultra    $2700
CowCity Computers     P133+        $2450
CMF Computers         P150z        $2610

The columns will be aligned regardless of the font size. In the next two examples the above table is embedded between <font size="-1"> and </font> and between <font size="+1"> and </font> tags, respectively.

Layout
            Computer models

Manufacturer          Model        Price
=========================================
City Computers        P325 Plus    $2500
Midwest CPU           586/Ultra    $2700
CowCity Computers     P133+        $2450
CMF Computers         P150z        $2610

Layout
            Computer models

Manufacturer          Model        Price
=========================================
City Computers        P325 Plus    $2500
Midwest CPU           586/Ultra    $2700
CowCity Computers     P133+        $2450
CMF Computers         P150z        $2610
<== Back to Course