3

I want to draw a table given below as it is

enter image description here

I don't how to make it properly. I can make a table like this given below:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{table}[]
\begin{tabular}{llcr}
\cline{2-4}
 & \textbf{Class} & \textbf{Occupy} & \textbf{Run Time} \\ \cline{2-4} 
 & \begin{tabular}[c]{@{}l@{}}RM FM RF\\ FMKMRKF\\ MLRFKR\end{tabular} & R &  \\ \cline{2-4} 
 & RM F & R & R \\ \cline{2-4} 
 & FRR & R &  \\ \cline{2-4} 
 & \begin{tabular}[c]{@{}l@{}}CKRMKMR\\ F MRMR\\ FR M\end{tabular} & R4 & R \\ \cline{2-4} 
 & RF &  &  \\ \cline{2-4} 
 & FRFRMMK & 4R & 4 \\ \cline{2-4} 
\end{tabular}
\end{table}

\end{document}

which gives a table but very different looking then the expected. Some of the things I am not able to achieve is colors, solid lines etc.

Question : How to make a table given in the image?

3

try the following:

\documentclass{article}
\usepackage[table]{xcolor}
\newcommand\mrh{\color{white}\bfseries}
\newcommand\mrc[1]{\begin{tabular}{@{}l@{}} #1 \end{tabular}}
\setlength\arrayrulewidth{0.8pt}

\begin{document}
    \begin{table}[htb]
    \arrayrulecolor{white}
\begin{tabular}{>{\columncolor{gray!10}} l | c|r}
    \rowcolor{gray}
\mrh{Class}  & \mrh{Occupy}   & \mrh{Run Time}    \\
    \hline
    \rowcolor{gray!10}
\mrc{RM FM RF\\ FMKMRKF\\ MLRFKR}
                & R                 &                       \\
    \hline
    \rowcolor{gray!10}
RM F            & R                 & R                     \\
    \hline
    \rowcolor{gray!10}
FRR             & R                 &                       \\
    \hline
    \rowcolor{gray!10}
\mrc{CKRMKMR\\ F MRMR\\ FR M}
                & R4                & R                     \\
    \hline
    \rowcolor{gray!10}
RF              &                   &                       \\
    \hline
    \rowcolor{gray!10}
FRFRMMK         & 4R                & 4
\end{tabular}
    \end{table}
\end{document}

enter image description here

1

Maybe something like this?

\documentclass[10pt]{article}
\usepackage{amsthm,amsmath,bm}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{bigstrut}


\newcommand{\minitab}[2][1]{\begin{tabular}{#1}#2\end{tabular}}

\begin{document}
\begin{table}[htbp]
\arrayrulecolor{white}
  \centering
    \begin{tabular}{|c|c|c|c|}
    \hline
    \rowcolor[RGB]{96,96,96}       &       &       &  \\
    \rowcolor[RGB]{96,96,96} \multirow{-2}{*}{\textcolor[rgb]{ 1,  1,  1}{\textbf{1}}} & \multirow{-2}{*}{\textcolor[rgb]{ 1,  1,  1}{$\bm{c_{k}}$}} & \multirow{-2}{*}{\textcolor[rgb]{ 1,  1,  1}{\minitab[c]{\textbf{All optimal solutions} \\ \textbf{must satisfy}}}} & \multirow{-2}{*}{\textcolor[rgb]{ 1,  1,  1}{\minitab[c]{\textbf{Max values of coins}\\ \textbf{1,2,…,k-1 in any OPT}}}}\\
    \hline
    \rowcolor[RGB]{203,203,203} $\bm{1}$ & $\bm{1}$ & $\bm{P\leq4}$ & $\bm{-}$ \bigstrut\\
    \hline
    \rowcolor[RGB]{203,203,203} $\bm{2}$ & $\bm{5}$ & $\bm{N\leq1}$ & $\bm{4}$ \bigstrut\\
    \hline
    \rowcolor[RGB]{203,203,203} $\bm{3}$ & $\bm{10}$ & $\bm{N+D\leq2}$ & $\bm{4+5=9}$ \bigstrut\\
    \hline
    \rowcolor[RGB]{203,203,203} $\bm{4}$ & $\bm{25}$ & $\bm{Q\leq3}$ & $\bm{20+4=24}$ \bigstrut\\
    \hline
    \rowcolor[RGB]{203,203,203} $\bm{5}$ & $\bm{100}$ & \textbf{no limit} & $\bm{75+24=99}$ \bigstrut\\
    \hline
    \end{tabular}%
\end{table}%
\end{document}

enter image description here

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.