0

I have this table in my document, and as you can see the numbers in the to row are not centered, I tried to use some solutions from previous asked questions but none of them fixed this. enter image description here

The Latex code of this table is:

\begin{table*}[]
\centering

\documentclass[xcolor=table]{beamer}
\begin{tabular}{cccccc|P{0.02cm}|
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |
        >{\columncolor[HTML]{FD6864}}P{0.02cm} |}
    \cline{7-34}
    \multicolumn{1}{l}{}                                & \multicolumn{1}{l}{}                                   & \multicolumn{1}{l}{}                            & \multicolumn{1}{l}{}                             & \multicolumn{1}{l}{}                            & \multicolumn{1}{l|}{}                            & \multicolumn{28}{c|}{\cellcolor[HTML]{C0C0C0}\textbf{Something}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    \\ \hline
    \multicolumn{1}{|l|}{\cellcolor[HTML]{C0C0C0}One} & \multicolumn{1}{l|}{\cellcolor[HTML]{C0C0C0}Two} & \multicolumn{1}{l|}{\cellcolor[HTML]{C0C0C0}Three} & \multicolumn{1}{l|}{\cellcolor[HTML]{C0C0C0}Four} & \multicolumn{1}{l|}{\cellcolor[HTML]{C0C0C0}Five} & \multicolumn{1}{l|}{\cellcolor[HTML]{C0C0C0}Six} & \cellcolor[HTML]{C0C0C0}1 & \cellcolor[HTML]{C0C0C0}2 & \cellcolor[HTML]{C0C0C0}3 & \cellcolor[HTML]{C0C0C0}4 & \cellcolor[HTML]{C0C0C0}5 & \cellcolor[HTML]{C0C0C0}6 & \cellcolor[HTML]{C0C0C0}7 & \cellcolor[HTML]{C0C0C0}8 & \cellcolor[HTML]{C0C0C0}9 & \cellcolor[HTML]{C0C0C0}10 & \cellcolor[HTML]{C0C0C0}11 & \cellcolor[HTML]{C0C0C0}12 & \cellcolor[HTML]{C0C0C0}13 & \cellcolor[HTML]{C0C0C0}14 & \cellcolor[HTML]{C0C0C0}15 & \cellcolor[HTML]{C0C0C0}16 & \cellcolor[HTML]{C0C0C0}17 & \cellcolor[HTML]{C0C0C0}18 & \cellcolor[HTML]{C0C0C0}19 & \cellcolor[HTML]{C0C0C0}20 & \cellcolor[HTML]{C0C0C0}21 & \cellcolor[HTML]{C0C0C0}22 & \cellcolor[HTML]{C0C0C0}23 & \cellcolor[HTML]{C0C0C0}24 & \cellcolor[HTML]{C0C0C0}25 & \cellcolor[HTML]{C0C0C0}26 & \cellcolor[HTML]{C0C0C0}27 & \cellcolor[HTML]{C0C0C0}28 \\ \hline
    \multicolumn{1}{|c|}{I}                             & \multicolumn{1}{c|}{-----}                             & \multicolumn{1}{c|}{5}                          & \multicolumn{1}{c|}{43}                       & \multicolumn{1}{c|}{3}                          & 0                                                & \cellcolor[HTML]{32CB00}  &                           &                           &                           &                           &                           &                           &                           &                           &                            &                            &                            &                            &                            &                            & \cellcolor[HTML]{32CB00}   &                            &                            &                            &                            & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   &                            &                            &                            &                            &                            & \cellcolor[HTML]{32CB00}   \\ \hline
    \multicolumn{1}{|c|}{II}                            & \multicolumn{1}{c|}{0}                              & \multicolumn{1}{c|}{4}                         & \multicolumn{1}{c|}{5}                       & \multicolumn{1}{c|}{2}                         & 3                                            & \cellcolor[HTML]{32CB00}  & \cellcolor[HTML]{32CB00}  & \cellcolor[HTML]{32CB00}  & \cellcolor[HTML]{32CB00}  & \cellcolor[HTML]{32CB00}  & \cellcolor[HTML]{32CB00}  &                           & \cellcolor[HTML]{32CB00}  & \cellcolor[HTML]{32CB00}  & \cellcolor[HTML]{32CB00}   &                            & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   &                            & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   & \cellcolor[HTML]{32CB00}   &                            \\ \hline
    \multicolumn{1}{|c|}{III}                           & \multicolumn{1}{c|}{0}                                 & \multicolumn{1}{c|}{0}                          & \multicolumn{1}{c|}{0}                           & \multicolumn{1}{c|}{0}                          & 0                                                & \cellcolor[HTML]{FD6864}  &                           &                           &                           &                           &                           &                           &                           &                           &                            &                            &                            &                            &                            &                            & \cellcolor[HTML]{FD6864}   &                            &                            &                            &                            & \cellcolor[HTML]{FD6864}   & \cellcolor[HTML]{FD6864}   &                            &                            &                            &                            &                            &                            \\ \hline
    \multicolumn{1}{|c|}{IV}                            & \multicolumn{1}{c|}{0}                                 & \multicolumn{1}{c|}{0}                          & \multicolumn{1}{c|}{0}                           & \multicolumn{1}{c|}{0}                          & 0                                                & \cellcolor[HTML]{FD6864}  &                           &                           &                           &                           &                           &                           &                           &                           &                            &                            &                            &                            &                            &                            & \cellcolor[HTML]{FD6864}   &                            &                            &                            &                            & \cellcolor[HTML]{FD6864}   & \cellcolor[HTML]{FD6864}   &                            &                            &                            &                            &                            &                            \\ \hline
    \multicolumn{1}{|c|}{V}                             & \multicolumn{1}{c|}{0}                                 & \multicolumn{1}{c|}{0}                          & \multicolumn{1}{c|}{0}                           & \multicolumn{1}{c|}{0}                          & 0                                                & \cellcolor[HTML]{FD6864}  &                           &                           &                           &                           &                           &                           &                           &                           &                            &                            &                            &                            &                            &                            & \cellcolor[HTML]{FD6864}   &                            &                            &                            &                            & \cellcolor[HTML]{FD6864}   & \cellcolor[HTML]{FD6864}   &                            &                            &                            &                            &                            &                            \\ \hline
\end{tabular}

\end{table*}

Is someone has a solution? Thank you!

EDIT: the P is defined as:

\newcolumntype{P}[1]{>{\parbox{20em}}m{#1}}
  • Welcome to TeX.SX! Please turn your code fragment into a compilable minimal working example (MWE) that includes the documentclass and all relevant packages that are needed to reproduce the shown output. (How is the P type column defined? ...) Apart from that, you might be interested in How to create fixed width table columns with text raggedright/centered/raggedleft? – leandriis Jan 27 at 13:41
  • Apart from my previous comment, a table with more than 30 columns is most likely a lot wider than the textwidth and will not fit onto yor frame even if you use an extremely small fontsize and tabcolsep. You might also want to define a custom command instead of using \cellcolor[HTML]{C0C0C0} and others over and over again. That way it would be easier if you want to change a color later on. – leandriis Jan 27 at 13:49
  • 1
    Thanks for your edit. It looks like you've got two separate accounts.The Stack Exchange staff can merge them together for you. – leandriis Jan 27 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.