latex tabular, this is the page you want. The tabular environment creates the actual rows and columns inside a LaTeX table.
Quick answer: define the column layout in
\begin{tabular}{...}, separate cells with &, and end each row with \\.Related topics: Creating tables in LaTeX | Advanced tables | Professional tablesBasic tabular Syntax
- Code
- Rendered output
tabular-basic.tex
lmeans left-aligned columncmeans centered columnrmeans right-aligned column&separates columns\\ends the row
A Minimal Example
- Code
- Rendered output
minimal-tabular.tex
Column Alignment Options
| Column type | Meaning |
|---|---|
l | Left aligned |
c | Center aligned |
r | Right aligned |
p{width} | Fixed-width paragraph column |
m{width} | Fixed-width column with vertical centering |
b{width} | Fixed-width column aligned at the bottom |
m{} and b{}, load the array package.
Horizontal Lines and Better Rules
The simplest way to draw lines is with\hline:
- Code
- Rendered output
tabular-lines.tex
booktabs:
- Code
- Rendered output
tabular-booktabs.tex
table vs tabular
These are different:
tabularcreates the grid of rows and columnstableis a float wrapper used for captions, labels, and placement
- Code
- Rendered output
table-vs-tabular.tex
Spanning Columns with \multicolumn
Use \multicolumn when one cell should cover multiple columns:
- Code
- Rendered output
multicolumn.tex
When tabular Is Not Enough
Use a different tool when you need more than a basic grid:
tabularxfor tables that should fill a fixed widthlongtablefor tables that span multiple pagessiunitxwhen you need decimal alignmentbooktabsfor cleaner horizontal rules
Common tabular Problems
- Columns do not line up: check that every row has the same number of
&separators. - Text runs too wide: switch to
p{width}ortabularx. - Caption does not work: wrap
tabularinsidetable. - Numbers look uneven: use
siunitxinstead of plainralignment.
