5

I want to align a table created with pgfplotstable to the top in an enumerate environment, but instead it's aligned to the center. How can I fix this? I'm looking for something like the [t] option for tabular.

MWE:

\documentclass{article}

\usepackage{filecontents}
\usepackage{pgfplotstable}

\begin{filecontents}{data.txt}
Frequency None Carpet Polystyrene Foam gibboard
180       560  322    47.2        428  41.2
950       58.4 45.6   42.8        55.2 48.4
2200      48.4 43.2   44          60   50.8
\end{filecontents}

\begin{document}
\begin{enumerate}
  \item \pgfplotstabletypeset [columns/gibboard/.style={column name=Gib board}] {data.txt}
\end{enumerate}
\end{document}

enter image description here

1 Answer 1

7

The tabular environment is contained in a begin table pgfkey and is initially \begin{tabular} (see current manual of pgfplotstable package, v. 1.12.1, as of (2015/05/02))

If the table should be top-aligned, say begin table={\begin{tabular}[t]} as an option to the \pgfplotstabletypeset command.

\documentclass{article}

\usepackage{filecontents}
\usepackage{pgfplotstable}

\begin{filecontents}{data.txt}
Frequency None Carpet Polystyrene Foam gibboard
180       560  322    47.2        428  41.2
950       58.4 45.6   42.8        55.2 48.4
2200      48.4 43.2   44          60   50.8
\end{filecontents}

\begin{document}
\begin{enumerate}
  \item \pgfplotstabletypeset [begin table={\begin{tabular}[t]},columns/gibboard/.style={column name=Gib board}] {data.txt}
\end{enumerate}
\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 .