Tx · LaTeX & TikZ

How to Fit a Table into One Column in a Two-Column Document

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose the float

    Use table for a one-column float; use table* only when the table should span both columns.

  2. 2. Set the column width

    Size the tabular material to the current column, not the full page width.

  3. 3. Wrap long text

    Use tabularx or paragraph columns so lengthy cell contents break across lines.

  4. 4. Check the result

    Compile and adjust column types, spacing, or font size before shrinking the whole table.

A table that is too wide for one column usually needs a narrower layout, not a different float. In a standard two-column LaTeX document, use table for a one-column float and size its contents to the column width. For long text, use columns that wrap instead of allowing each cell to expand horizontally.

Use the correct width and float

In a two-column document, \textwidth is the width of the full text area across both columns. \columnwidth is the width of one column. For a table that belongs in one column, use \columnwidth (or, in many contexts, \linewidth, which is the current available line width).

A table float is intended for a single column. A table* float spans both columns, so it is not the fix for a table that must remain in one column. In standard two-column layouts, wide floats may also have fewer placement options than ordinary floats.

Wrap long cells with tabularx

The tabular environment chooses column widths from the contents. A long phrase or heading can therefore make the whole table too wide. The tabularx package provides an X column that expands to fill a specified width and wraps text as needed.

This complete example makes a one-column table whose total width is the current column width:

\documentclass[twocolumn]{article}
\usepackage{booktabs}
\usepackage{tabularx}

\begin{document}

Text in the first column. The table will float to a suitable position.

\begin{table}[tb]
  \centering
  \small
  \caption{Example results}
  \label{tab:results}
  \begin{tabularx}{\columnwidth}{@{}l r X@{}}
    \toprule
    Task & Time (s) & Notes \\
    \midrule
    Data cleaning & 12.4 & Remove duplicate records and standardize labels. \\
    Regression & 3.8 & Fit the model and check the residuals for patterns. \\
    \bottomrule
  \end{tabularx}
\end{table}

See Table~\ref{tab:results} for the results.

\end{document}

The l and r columns align short entries on the left and right. The X column takes the remaining width and wraps its text. The @{} entries remove the usual padding at the outer table edges. \small reduces the table font slightly; remove it if the table is already readable at the document’s normal size. The booktabs package provides the horizontal rules.

Other ways to reduce the width

If you do not need a flexible-width column, choose explicit column types. For example, p{2cm} creates a paragraph column with a width of 2 cm, and its contents wrap. A declaration such as \begin{tabular}{p{2cm}r} can work well when you know the required widths. Check that the combined column widths and intercolumn padding fit within the column.

You can also make modest adjustments to the table itself:

  • Shorten headings and cell text where meaning is preserved.
  • Use \small or, if necessary, \footnotesize locally inside the table.
  • Reduce horizontal padding with \setlength{\tabcolsep}{...} inside a group so the change does not affect other tables.
  • Split a table into two smaller tables if its information naturally divides.

As a last resort, \resizebox{\columnwidth}{!}{...} from the graphicx package scales a complete table to fit. This can make the text too small, and it does not make long text wrap; prefer adjusting the column layout first.

If you are using the multicols package

The multicols environment from the multicol package is not the same as a document declared with the twocolumn class option. Ordinary floats such as table generally cannot be placed inside a multicols environment. Instead, put a nonfloating tabular there and, if it needs a caption, use \captionof{table}{...} from the caption package. Set its width to \linewidth, which is the width available in the current multicols column. Alternatively, place a normal floating table outside the multicols environment.

Common mistakes

  • Using \textwidth for a one-column table: that width covers both columns, so the table can intrude into the neighboring column. Use \columnwidth or the current \linewidth instead.
  • Expecting table to control the tabular width: the float positions and captions the table; the tabular or tabularx environment determines its width.
  • Trying to shrink an unbreakable entry: a long URL, identifier, or word may not wrap in an ordinary column. Provide suitable break points or use a column and package designed for that content.
  • Using table* unnecessarily: this produces a two-column-wide float rather than a one-column table.
  • Ignoring the compilation warning: an overfull box warning is a sign that some material still exceeds the available width. Inspect long cells and column padding, then compile again to check the rendered result.

References

  1. The tabularx package
  2. The LaTeX2e unofficial reference manual: Two-column mode
  3. The multicol package

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.