pgfplotstable:消除第一列

pgfplotstable:消除第一列

样本数据的第一列没有显示任何内容,但表格中却显示零。如何删除第 0 列中的零 (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} 

答案1

\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} 

相关内容