0

I'm having trouble when trying to center columns in a three part table enviroment. My code:

 \begin{table}[H]
\centering
\begin{ThreePartTable}
\let\TPTrlap\relax

\begin{tabularx}{\textwidth}{@{}
            >{}R
            >{\hsize=1.5\hsize}R
            >{\hsize=1.0\hsize}R
            >{\hsize=0.5\hsize}R
                            @{\hspace{0.5\tabcolsep}}}
\caption{Custo Fixo Total}
\label{tab:} \\
\midrule
\upshape Material& Custo (R\$) &Quantidade&Total (R\$) \\
\midrule
\endfirsthead
\caption{Custo Fixo Total (cont.)}
\label{tab:} \\
\midrule
\upshape Material& Custo &Quantidade&Total \\
\midrule
\endhead
\midrule
\multicolumn{5}{r}{\footnotesize\itshape continua na próxima página}
\endfoot
\midrule[1pt]
\insertTableNotes
\endlastfoot


 Acabamentos MDF &-&-& \\
\addlinespace
 Botão Push Button&1,12/ unidade&1&1,12 \\
\addlinespace
 Chapa MDF&59,80/m^{2}&1,4&83,72\\
\addlinespace
 Dobradiças&0,33/ unidade&3&0,99 \\
\addlinespace
 Espátula plástica&0,80/ unidade&1&0,80\\
\addlinespace
 Estilete&0,90/ unidade&1&0,90\\
\addlinespace
 Fio paralelo \SI{2,5}{\mm^{2}}&3,24/m&1,5&4,86\\
\addlinespace
 Interruptor&1,05/ unidade&3&3,15\\
\addlinespace
 Micro retífica + eixo flexível&129,90/ unidade&1&129,90\\
\addlinespace
 Rolo pequeno de pintura&3,39/ unidade&1&3,39 \\
\addlinespace
 Secador&34,76&1&34,76 \\
\addlinespace
 Tira de \textit{LED}&24,90/ 50 cm&5&124,50 \\
\addlinespace
Tomadas fêmea &1,00/ unidade&3&3,00 \\
\addlinespace
 Tomada macho&1,00/ unidade&1&1,00 \\
\addlinespace
 Ventosa&1,00/ unidade&1&1,00 \\


\end{tabularx}
\end{ThreePartTable}
\end{table}

This is what it looks like: I would like at least the colum "Quantidade" centered

  • Please tell us how the R column type is defined. – Mico Jun 27 '18 at 4:57
  • Oh sorry I don't know that :( – Graziella Bedenik Jun 27 '18 at 12:16
2

Change R to c:

\begin{tabularx}{\textwidth}{@{}
                >{}R
                >{\hsize=1.5\hsize}c
                >{\hsize=1.0\hsize}c
                >{\hsize=0.5\hsize}c
  • 2
    This won't work. The {\hsize=x\hsize} prefixes must be associated with a variable-width column type, such as X (or one of it's derived forms). If we had \newcolumntype{C}{>{\centering\arraybackslash}X}, then >{\hsize=1.5\hsize}C would work. – Mico Jun 27 '18 at 4:58

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.