I have the following table:
From the code:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[brazil]{babel}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage{newtxtext,newtxmath}
\usepackage{array,ragged2e,tabularx,multirow}
\begin{document}
\section{Custos}
\begin{tabular}
{|
*1{@{\hspace{3.0pt}}>{ \RaggedRight\arraybackslash\hsize=1.1\hsize }p{3.9cm}|} % Item
*1{@{\hspace{3.0pt}}>{ \RaggedRight\arraybackslash\hsize=1.1\hsize }p{1.9cm}|} % Quantidade
*1{@{\hspace{3.0pt}}>{ \RaggedRight\arraybackslash\hsize=1.1\hsize }p{3.0cm}|} % Valor, Valor
*1{@{\hspace{3.0pt}}>{ \RaggedRight\arraybackslash\hsize=1.1\hsize }p{2.6cm}|} % Valor, Valor
}
\hline Item & Quantidade & Valor Unitário (R\$) & Valor Total (R\$) \\ \hline
CD & 1 & 5,00 & 5,00,00 \\ \hline
Impressão & 800 & 0,15 & 120,00 \\ \hline
Reserva Gerencial & 1 & 20,00 & 20,00 \\ \hline
Reserva de Contingência & 1 & 20,00 & 20,00 \\ \hline
Total & \multicolumn{2}{c c|}{} & 165,00 \\ \hline
\end{tabular}
\end{document}
But is throwing the error:
test.tex:29: Package array Error: Only one column-spec. allowed.. [... & \multicolumn{2}{c c}{}]
The table is rendering almost as I like to, except for the shifted |
before 165,00
.
How to remove the error from appearing and align correctly the shifted |
pipe?
Update
Nice list for references:
Best Answer
\multicolumn
can have only one column specifier. You have two! However, why do you have such complicated head definition. This does the same: