next up previous contents
Next: Sectioning and Cross-references Up: Commands for Text Mode Previous: Spacing

Tables

 

To generate tables, use the tabular environment. For example,

\begin{center}
\begin{tabular}{c|ccccccc|}
  $\lambda$& (5)& (4,1)& (3,2)& (3,1,1)& (2,2,1)& (2,1,1,1)&
       (1,1,1,1,1)\\
\hline 
  $d_{_\lambda}$& 1& 4& 5& 6& 5& 4& 1\\ 
\end{tabular}
\end{center}
generates

tex2html_wrap_inline2543 (5) (4,1) (3,2) (3,1,1) (2,2,1) (2,1,1,1) (1,1,1,1,1)
tex2html_wrap_inline2545 1 4 5 6 5 4 1

The string {c|ccccccc|} describes the layout of the table. The 8 c's specify that the table has 8 columns, and the entries in each column are to be centered. You can also use l and r to make columns in which the entries are, respectively, left- and right-justified. The vertical bar characters, |, indicate that there are to be vertical lines between the first and second columns, and after the eighth. The table is enclosed in a center environment to center the table as a whole on the page.

The text of the table itself appears after the string specifying the column layout. Entries in the table are separated by the ampersands &, and each row is ended with a carriage return command, \\ . The \hline command produces a horizontal line which runs the width of the table. The tabular environment and its relatives can be used to produce some pretty sophisticated tables; consult the latex references for more information.



Processed by LaTeX2html