1

I use vertical centered table cells and use $\vcenter{\hbox{#1}}$. The result is ok, but:
How can I get some additional space here:

enter image description here

Please note that this is completely arbitrary table and can change in content, width, height, h-lines, v-lines,...... at any time. Individual adjustments such as adding an 0pt rule on a case-by-case basis are not desirable.

\documentclass[]{article}
%\usepackage{booktabs, array}
% \setlength{\defaultaddspace}{0pt} 
%\setlength{\extrarowheight}{10mm}
%    \renewcommand{\arraystretch}{2.9}

\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\pgfplotstableset{
string type, col sep=comma, header=false,
column type/.add={|}{|}, 
assign column name/.style={
/pgfplots/table/column name={\textbf{#1}}
},
% vertical (help) lines
every head row/.style={before row=\hline},
every even row/.style={before row=\hline,   after row=\hline},
every last row/.style={after row=\hline},
}
\begin{document}
\pgfplotstableread[]{
a,                           abc abc abc,         c
{\tiny a},                b,                        {\Huge C}
T,                          {2},                      {\rule{50pt}{30pt}}
,                             b,                        c
}\mytable

\pgfplotstabletypeset[
every column/.style={
postproc cell content/.style={@cell content=$\vcenter{\hbox{##1}}$}    },
]{\mytable}
\end{document}
2
  • 2
    $\vcenter{\vskip2pt\hbox{##1}\vskip2pt}$} ? Commented Sep 9, 2020 at 17:27
  • This way $\vcenter{\vskip2pt\hbox{##1}\vskip2pt}$ ist works.
    – cis
    Commented Sep 9, 2020 at 17:35

1 Answer 1

3

You could add padding (say 2pt) within the centred box

$\vcenter{\vskip2pt\hbox{##1}\vskip2pt}$

You must log in to answer this question.

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