1

I've been trying to insert a table, that is essentially quite simple, into a two-column document. It has been throwing up all sorts of warnings (most perplexingly: Missing number, treated as zero for the begin{tabular*} line.

I would like it to look like a simple cross-shaped table, but inserting \hlines makes the whole thing crash. What happens with this code (see the example below) is that the table floats off the right side of the page, the {p|p} is shown on the left side of the table (which does not happen if I replace that with {c|c}), and the ampersands don't appear to be recognised as the column change.

The table should not take any notice of the two-columness of the rest of the doc, which is why the *s are added, I believe.

\documentclass[a4paper, twocolumn]{article}
\usepackage{dblfloatfix} % floats in twocolumns come out in the right order

\begin{document}

\begin{table*}[t]
    \caption{problematic table}
    \label{tab:ohNo}
    \begin{tabular*}{p|p} 
    Title 1 & Title 2 \\
    there is no definitive formulation of a wicked problem & Energy efficiency can be framed as a techno-economic problem, or a problem related to fundamental issues as lifestyle and such. \\ 
    wicked problems have no stopping rule & Energy efficiency is a continuous process and must be related to many different factors such as cost efficiency and employees health and safety. 
    \end{tabular*}
\end{table*}

\end{document}
1
  • 2
    Welcome! You have to specify the widths of the columns.
    – Bernard
    Commented May 6, 2022 at 8:45

1 Answer 1

1
  • Environment tabular* require specification for table width. In your case something like \begin{tabular*}{\linewidth}{<column specification>}
  • Column p had to have defined width. For example p{0.45\linewidth}
  • It seems, that package tabularx with X columns type which width determine LaTeX) solve your problem on the simplest way:
\documentclass[a4paper, twocolumn]{article}
\usepackage{tabularx}

\begin{document}

\begin{table*}[t]
    \caption{problematic table}
    \label{tab:ohNo}
    \begin{tabularx}{\linewidth}{X|X}
    Title 1 & Title 2 \\
there is no definitive formulation of a wicked problem  
            & Energy efficiency can be framed as a techno-economic problem, or a problem related to fundamental issues as lifestyle and such. \\
wicked problems have no stopping rule 
            & Energy efficiency is a continuous process and must be related to many different factors such as cost efficiency and employees health and safety.
    \end{tabularx}
\end{table*}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .