3

Nothing is shown in the first column of the sample data, yet a zero shows up in the table. How do I remove the zero (0) in column 0?

\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage[paperwidth=50cm,paperheight=5cm]{geometry}

\begin{document}
\noindent\pgfplotstabletypeset[col sep=&, row sep=\\,
    every head row/.style={%
         before row={\toprule%
         &\multicolumn{1}{c}{P.R.}
         &\multicolumn{1}{c}{Boat}
         &\multicolumn{1}{c}{Inspecting}
         &\multicolumn{1}{c}{No. Boats}
         &\multicolumn{2}{c}{Ardvaarks}\\
         &\multicolumn{1}{c}{Date \& Link}
         &\multicolumn{1}{c}{Yard}
         &\multicolumn{1}{c}{Agency}
         &\multicolumn{1}{c}{Looked}
         &\multicolumn{1}{c}{Non-Critical}
         &\multicolumn{1}{c}{Critical}\\\midrule},
        },
  every last row/.style={after row=\bottomrule},
  string type,
   ]
    {
    %sample data
      & a1 & 26 & a94.6513 & 0.9995 & T145.6622 & 0.9999  \\
      & b2 & 25 & 84.5684  & 0.8296 & 131.5305  & VV0.8881\\
    }

\end{document} 
  • You may combine output empty row and header=false. The zero you saw is in fact the name of the first column. – Symbol 1 Oct 23 '16 at 20:42
2
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage[paperwidth=50cm,paperheight=5cm]{geometry}
\begin{document}
\noindent\pgfplotstabletypeset[col sep=&, row sep=\\,
    every head row/.style={%
         before row={\toprule%
         {P.R.}
         & {Boat}
         &{Inspecting}
         &{No. Boats}
         &\multicolumn{2}{c}{Ardvaarks}\\
         {Date \& Link}
         &{Yard}
         &{Agency}
         &{Looked}
         &{Non-Critical}
         &{Critical}\\\midrule},
        },
  every last row/.style={after row=\bottomrule},
  string type,
   ]
    {
    %sample data
       a1 & 26 & a94.6513 & 0.9995 & T145.6622 & 0.9999  \\
       b2 & 25 & 84.5684  & 0.8296 & 131.5305  & VV0.8881\\
    }
\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.