I am trying to build a table with alternate evenly distributed columns and with each second column aligned to the decimal points.
By googling, I arrived to the following code:
\usepackage{tabularx}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{\cdot}{#1} }
\usepackage{array,booktabs,makecell}
\renewcommand\theadalign{cc}% centred tabular headers
\begin{table}
\caption{\label{tab1}Table 1}
\begin{tabularx}{\textwidth}{|X|d{2}||X|d{2}||X|d{2}|}
\hline
\thead{\textit{Country}} & \thead{\textit{Weight}} & \thead{\textit{Country}} & \thead{\textit{Weight}} & \thead{\textit{Country}} & \thead{\textit{Weight}} \\
\hline
\hline
\textbf{Belgium} & $ 2.92 $ & \textbf{Croatia} & $ 0.39 $ & \textbf{Poland} & $ 3.63 $ \\
\hline
\textbf{Bulgaria} & $ 0.32 $ & \textbf{Italy} & $ 12.39 $ & \textbf{Portugal} & $ 1.19 $ \\
\hline
\textbf{Czech Rep.} & $ 1.94 $ & \textbf{Cyprus} & $ 0.08 $ & \textbf{Romania} & $ 1.01 $ \\
\hline
\textbf{Denmark} & $ 1.88 $ & \textbf{Latvia} & $ 0.11 $ & \textbf{Slovenia} & $ 0.37 $ \\
\hline
\textbf{Germany} & $ 27.18 $ & \textbf{Lithuania} & $ 0.16 $ & \textbf{Slovakia} & $ 0.65 $ \\
\hline
\textbf{Estonia} & $ 0.13 $ & \textbf{Luxembourg} & $ 0.14 $ & \textbf{Finland} & $ 1.63 $ \\
\hline
\textbf{Ireland} & $ 1.77 $ & \textbf{Hungary} & $ 1.06 $ & \textbf{Sweden} & $ 3.09 $ \\
\hline
\textbf{Greece} & $ 1.08 $ & \textbf{Malta} & $ 0.04 $ & \textbf{UK} & $ 11.88 $ \\
\hline
\textbf{Spain} & $ 6.66 $ & \textbf{Netherlands} & $ 3.97 $ & \textbf{EA19} & $ 74.80 $ \\
\hline
\textbf{France} & $ 11.61 $ & \textbf{Austria} & $ 2.72 $ & \textbf{EU28} & $ 100.00 $ \\
\hline
\end{tabularx}
\end{table}
However, with this code I get this:
So I have two problems: 1) For some reason the column "weight" is too large, with extra space on the right 2) Some text of the column "Country" is too big for size of the cell. Is this because of the size of the page?
Thanks!




