5

I want to create the following table enter image description here

Can someone help me because I have no much experience with Latex. What I have got is the following

\documentclass{standalone}
\usepackage{tikz}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}
\begin{document}
    \begin{table}[ht]
      \centering
      \begin{tabular}{|c|c|}
        Discrete & Continuous \\
        Discrete Paramater Markov chain & Discrete Paramater Markov process \\
        \hline \\
        Continuous Paramater Markov chain & Continuous Paramater Markov process \\
        \hline \\
      \end{tabular}
      \caption{Markov processes classified into four basic types}\label{tab2}
    \end{table}
\end{document}

enter image description here

3
  • 4
    That's not a complicated table and you can certainly at least make an example with the text and the lines. Jan 22, 2019 at 20:44
  • 1
    As already said for your previous questions: please make a minimal working example (MWE) that shows us what you have tried so far. Jan 22, 2019 at 20:58
  • I have edited my question
    – wayne
    Jan 22, 2019 at 21:05

4 Answers 4

3

The following should provide you with a complete foundation:

  • caption to format the table captions;

  • General layout of the 2D structure

enter image description here

\documentclass{article}

\usepackage{caption,makecell,graphicx}

\captionsetup[table]{
  labelfont = sc,
  labelsep = period,
  textfont = bf
}

\begin{document}

\begin{table}
  \centering
  \caption{Markov processes classified into four basic types}
  \begin{tabular}{ c | c | c | c | }
    \multicolumn{2}{c}{} & \multicolumn{2}{c}{State space} \\
    \cline{3-4}
    \multicolumn{2}{c}{} & \multicolumn{1}{c}{Discrete} & \multicolumn{1}{c}{Continuous} \\
    \cline{3-4}
    \raisebox{-\normalbaselineskip}[0pt][0pt]{\makecell{Nature of \\ parameter}} & 
      Discrete & \makecell{Discrete parameter \\ Markov chain} & \makecell{Discrete parameter \\ Markov process} \\
    \cline{3-4}
    &
      Continuous & \makecell{Continuous parameter \\ Markov chain} & \makecell{Continuous parameter \\ Markov process} \\
    \cline{3-4}
  \end{tabular}
\end{table}

\end{document}
5

Like Werner's answer but without \raisebox and with \multirows.

I've also used \setlength\extrarowheight{2pt} for better vertical spacing.

\documentclass{article}
\usepackage{caption,makecell}
\captionsetup[table]{
  labelfont = sc,
  labelsep = period,
  textfont = bf
}
\usepackage{multirow}

\begin{document}

\begin{table}
  \centering\setlength\extrarowheight{2pt}
  \caption{Markov processes classified into four basic types}
  \begin{tabular}{ c | c | c | c | }
    \multicolumn{2}{c}{} & \multicolumn{2}{c}{State space} \\
    \cline{3-4}
    \multicolumn{2}{c}{} & \multicolumn{1}{c}{Discrete} & \multicolumn{1}{c}{Continuous} \\
    \cline{3-4}
    \multirow{4}{*}{\makecell{Nature of\\ parameter}} & 
      \multirow{2}{*}{Discrete} & Discrete parameter  & Discrete parameter  \\[-2pt]
    & &  Markov chain &  Markov process \\
    \cline{3-4}
    & \multirow{2}{*}{Continuous} & Continuous parameter  & Continuous parameter  \\[-2pt]
        &  &  Markov chain &  Markov process \\
    \cline{3-4}
  \end{tabular}
\end{table}

\end{document}

enter image description here

1

A little bit late for OP, but here is the tabular built with cals, maybe useful for others. \lb, \rb, \tb, \bb = switch off left, right, top and bottom border (rule) respectively:

\documentclass{article}
\usepackage{caption,cals}
\captionsetup[table]{
  labelfont = sc,
  labelsep = period,
  textfont = bf
}
\makeatletter
\let\nc=\nullcell                                                  % Shortcuts
\let\sc=\spancontent
\newcommand{\ml}{\hspace*{1.75em}}

\def\tb{\ifx\cals@borderT\relax     % Top border switch (off-on)
\def\cals@borderT{0pt}
\else \let\cals@borderT\relax\fi}

\def\bb{\ifx\cals@borderB\relax     % Bottom border switch (off-on)
\def\cals@borderB{0pt}
\else \let\cals@borderB\relax\fi}

\def\rb{\ifx\cals@borderR\relax     % Right border switch (off-on)
\def\cals@borderR{0pt}
\else \let\cals@borderR\relax\fi}

\def\lb{\ifx\cals@borderL\relax     % Left border switch (off-on)
\def\cals@borderL{0pt}
\else \let\cals@borderL\relax\fi}
\makeatother

\begin{document}

\begin{table}[ht]
\caption{Markov processes classified into four basic types}
\small
\begin{calstable}[c] % Centre the tabular

% Defining columns relative to the margin 
\colwidths{{\dimexpr(\columnwidth)/40*8\relax}
            {\dimexpr(\columnwidth)/40*8\relax}
            {\dimexpr(\columnwidth)/40*12\relax}
            {\dimexpr(\columnwidth)/40*12\relax}
            }

% Set up the tabular
\makeatletter
\def\cals@framers@width{0.4pt}   % Outside frame rules, reduce if the rule is too heavy
\def\cals@framecs@width{0.4pt}
\def\cals@bodyrs@width{0.4pt}
\def\cals@cs@width{0.4pt}             % Inside rules, reduce if the rule is too heavy
\def\cals@rs@width{0.4pt}

% R1H1
\thead{\bfseries
\brow
    \tb\rb\lb\nc{lt}
    \nc{rt}
    \nc{ltb}
    \nc{rtb}\alignC\sc{\vfil State space}\lb\rb\tb
\erow
\mdseries
}
% R2B1
\brow
    \bb\rb\lb\nc{lb}
    \nc{rb}\sc{}\bb
    \cell{\vfil Discrete}
    \cell{\vfil Continuous}\lb\rb
\erow
% R3B2
\brow
    \tb\lb\nc{lrt}\lb\tb
    \nc{lrt}
    \cell{\vfil Discrete paramete}
    \cell{\vfil Discrete paramete}
\erow
% R4B3
\brow
    \lb\nc{lr}\lb
    \bb\nc{lrb}\sc{\vfil Discrete}\bb
    \tb\cell{\vfil Markov chain}\tb
    \tb\cell{\vfil Markov process}\tb
\erow
% R5B4
\brow
    \lb\nc{lr}\lb
    \nc{lrt}
    \cell{\vfil Continuous parameter}
    \cell{\vfil Continuous parameter}
\erow
% R6B5
\brow
    \bb\lb\nc{lrb}\sc{\vfil Nature of parameter}\lb\bb
    \bb\nc{lrb}\sc{\vfil Continuous}\bb
    \tb\cell{\vfil Markov chain}\tb
    \tb\cell{\vfil Markov process}\tb
\erow
\makeatletter
\end{calstable}\par % \par to align the tabular
\end{table}

\end{document}

enter image description here

0

Here the table:

\documentclass{article}
\usepackage{color}
\usepackage{multirow}

\begin{document}

\begin{table}
\centering
\caption{table}
\label{table}
\begin{tabular}{ccc|c|}
                                                          &                                                                                                     & \multicolumn{2}{c}{State space}                                                                                                                                                                                  \\ 
\cline{3-4}
                                                          &                                                                                                     & \multicolumn{1}{c}{\textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Discrete}}}      & \multicolumn{1}{c}{\textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Continuous}}}       \\ 
\cline{3-4}
\multicolumn{1}{c|}{\multirow{2}{*}{Nature of parameter}} & \multicolumn{1}{c|}{\textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Discrete}}}   & \textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Discrete Paramater Markov chain}}   & \textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Discrete Paramater Markov process}}    \\ 
\cline{3-4}
\multicolumn{1}{c|}{}                                     & \multicolumn{1}{c|}{\textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Continuous}}} & \textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Continuous Paramater Markov chain}} & \textcolor[rgb]{0.224,0.2,0.094}{\textcolor[rgb]{0.188,0.2,0.212}{Continuous Paramater Markov process}}  \\
\cline{3-4}
\end{tabular}
\end{table}
\end{document}
1
  • ("Here your table""Here is your table") Jan 23, 2019 at 6:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .