表格環境
tabular 環境是在 LaTeX 中建立表的最基本方法,不需要任何其他包。
\begin{tabular}{|lcr||}
  left aligned column & center column & right column \\
  \hline
  text & text & text \\
  text & text & text \\
\end{tabular}

引數(示例中的|lcr||)稱為**表規範,**並告訴 LaTeX 有多少列以及它們應該如何格式化。每個字母代表一列。可能的值是:
| 字元 | 含義 | 
|---|---|
| 升 | 左對齊列 | 
| C | 中心列 | 
| [R | 右對齊列 | 
| p {‘width’}例如 p{5cm} | 具有已定義寬度的段落列 | 
| (管道人物) | |
單元格由 & 字元分隔。一行由 2 個反斜槓\\結束。
可以使用\hline 命令插入水平線。
表格的格式總是足夠寬,以包含所有內容。如果桌子很大,LaTeX 會列印 overfull hbox 警告。可能的解決方案包括使用 p{'width'} 說明符或其他軟體包,如 tabularx。
可以使用命令\multicolumn{cols}{pos}{text} 建立一個跨越多列的列標題的表。
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
&\multicolumn{3}{|c|}{Income Groups}\\
\cline{2-4}
City&Lower&Middle&Higher\\
\hline
City-1& 11 & 21 & 13\\
City-2& 21 & 31 &41\\
\hline
\end{tabular}
\end{center}
https://i.stack.imgur.com/EEHSO.jpg
請注意,命令\multicolumn 有三個必需引數:第一個引數指定標題跨越的列數; 第二個引數指定了 heading(l,c,r) 的位置; 第三個引數是標題的文字。命令\cline{2-4} 指定要繪製直線的起始列(此處為 2)和結束列(此處為 4)。