1

I would like to format this table so that "presence of trait i" is printed vertically alongside a vertical rule left of the + and - sign, mimicking the horizontal "presence of trait j" in the following code. Additionally, I would like to know how to keep the position of "presence of trait j" above column 2 and 3, when I remove the \toprule.

\documentclass[twocolumn]{bmcart}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.14}
\usepackage{booktabs}

\begin{document}

\begin{table}[h]\centering
\pgfplotstabletypeset[
  every head row/.style={
    before row={\toprule & \multicolumn{2}{c}{presence of trait j} \\\cmidrule{2-3}},
    after row=\midrule},
  every column/.style={
  string type}
]{
Mode        -          +
+           a          b
-           c          d    
}
\end{table}

\end{document}

screen shot of result of current code

Thanks in advance!

Stendert
  • 11
  • 2
  • 2
    Welcome to TeX.SX. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with \documentclass, includes all relevant \usepackage commands, ends with \end{document} and compiles without errors, even if it does not produce your desired output. – Sandy G Jan 17 '18 at 17:06
  • If you are willing to use a tabular instead of a pgfplotstable, then you can use https://tex.stackexchange.com/questions/89115/how-to-rotate-text-in-multirow-table. – Marijn Jan 17 '18 at 20:33
  • I have updated the code to be a MWE. – Stendert Jan 18 '18 at 10:50
  • is it possible to maintain the lay out that is generated by pgfplotstable? – Stendert Jan 18 '18 at 10:51

0 Answers0