next up previous
Next: Enumerate and Itemize Environments Up: Environments Previous: Array Environment

Tabular Environment and Tables

There are two environments, tabbing and tabular, for producing tabular output. I shall discuss tabular environment alone since I find it more useful and I can get away with it practically all the time. As mentioned earlier, tabular environment is similar to the array environment. The tabular environment is more suitable for text material. Let us make a table of physical constants to illustrate the making of the table. The latex file is as shown below and the table appears as shown in Table(1)


Table 1: A list of some of the physical constants
Physical constant name value dimension
c velocity of light 2.998 x 108 m/sec
e electronic charge 1.602 x 10-19 coul
NA Avogadro number 6.02 x 1022 per mole
me Electron mass 9.11 x 10-31 kg

One can note the similarity between the table environment and tabular and array environments. In table environment one can give the caption or title and one can refer to it else where in the text ( see later ). Note that one has tabular rnvironmrnt inside the table environment and when one declares the tabular environment, one declares the number of columns and how the contents of the columns are placed. This is given in the first and second second set of braces respectively. Thus, in the table above, we have four items in each row and first two are left justified ( l ), the third is centered (c) and the last is right justified (r). verticle lines are drawn by inserting | at appropriate places. Horizontal lines are drawn by \hline declaration.


Table 2: A list of some of the physical constants
Physical constant name value dimension
c velocity of light 2.998 x 108 m/sec
e electronic charge 1.602 x 10-19 coul
NA Avogadro number 6.02 x 1022 per mole
me Electron mass 9.11 x 10-31 kg

Notice that center environment ( \begincenter ... \endcenter ) is invoked within table environment. This ensures that the table is centered. If we omit the center environment we will get 2.3. Note that the caption is still centered.

The table made below is more complex because in this table we have different number of columns for different rows. Essentially, what we have is, some columns in a row are spanning more than one columns. For example, the first row has two columns, the first spanning one column and the second spanning three columns. This is achieved by using \multicolumn command ( with the span of the wider column shown in the curly brackets ).


Table 3: A Complicated Table
one column three columns
item1 prop11 prop12 prop13
item2 prop21 prop22 prop23
two columns two columns
item3 prop31 prop32 prop33
And So On


next up previous
Next: Enumerate and Itemize Environments Up: Environments Previous: Array Environment
S.C.Phatak
2002-12-23