I created a table with https://www.tablesgenerator.com/latex_tables
I tried to limit the column width with
|l| p{1cm} |p{2cm} |p{1cm} |p{1cm} |p{2cm} |p{1cm} |p{1cm}|
But it doesn't see to have any effect.
The generated table
\begin{table}[]
\begin{tabular}{llllllll}
\hline
\multicolumn{1}{|l|}{} & \multicolumn{1}{l|}{Compute} & \multicolumn{1}{l|}{Pay As You Go} & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{Storage} & \multicolumn{1}{l|}{Pay As You Go} & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{Trail} \\ \cline{2-3} \cline{5-6} \cline{8-8}
\multicolumn{1}{|l|}{\multirow{-2}{*}{Provider}} & \multicolumn{1}{l|}{Terminology} & \multicolumn{1}{l|}{Unit} & \multicolumn{1}{l|}{\multirow{-2}{*}{Other Plans*}} & \multicolumn{1}{l|}{Terminology} & \multicolumn{1}{l|}{Unit} & \multicolumn{1}{l|}{\multirow{-2}{*}{Other Plans*}} & \multicolumn{1}{l|}{Period or Value} \\ \hline
\multicolumn{1}{|l|}{Windows Azure} & \multicolumn{1}{l|}{\cellcolor[HTML]{9AFF99}Virtual Server} & \multicolumn{1}{l|}{\cellcolor[HTML]{9AFF99}/hr} & \multicolumn{1}{l|}{\cellcolor[HTML]{9AFF99}1} & \multicolumn{1}{l|}{\cellcolor[HTML]{9AFF99}Azure Storage} & \multicolumn{1}{l|}{\cellcolor[HTML]{9AFF99}/GB month} & \multicolumn{1}{l|}{\cellcolor[HTML]{9AFF99}1} & \multicolumn{1}{l|}{\cellcolor[HTML]{9AFF99}90 day} \\ \hline
\end{tabular}
\end{table}
After I removed \multicolumn
, I got errors for
\multirow{-2}{p{1cm}}{Other Plans*}
main.tex, line 37
Missing number, treated as zero.
<to be read again>
p
l.37 ... & \multirow{-2}{p{1 cm}}{Other Plans*}
& Termin...
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
p
l.37 ... & \multirow{-2}{p{1 cm}}{Other Plans*}
& Termin...
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
See page 2 of the full example
https://www.overleaf.com/read/ywhjzprxmrgj
Best Answer
A couple of possibilities which don't generate an
overfull \hbox
with a standardarticle
documentclass:Please note that, for colored cells, I've used an appropriate
tabular
instead of\makecell
.I prefer the first, without vertical rules: