I'm begin in LaTeX and I generated the following table with the help of an online table generator. However, I have some issues with the centering of some cell contents.
Here is my code:
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{multirow}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{pgfplots}\pgfplotsset{compat=1.16}
\usepackage{xcolor}
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{N}{>{\centering\arraybackslash}m{.5in}}
\newcolumntype{G}{>{\centering\arraybackslash}m{2in}}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
%%\usepackage{array}
%%\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\begin{document}
\begin{table*}[htbp!]
\caption{Data quality alteration}
\begin{center}
\begin{tabular}{|C{1cm}|C{0.7cm}|C{1.7cm}|C{0.7cm}|C{1.7cm}|C{0.7cm}|C{1.7cm}|C{0.7cm}|C{1.7cm}|C{0.7cm}|C{1.7cm}|}
\hline
\multirow{3}{=}{\begin{tabular}[c]{@{}c@{}}\ \textbf{}\\\textbf{Anomaly}\end{tabular}}
& \multicolumn{10}{c|}{\textbf{System variables }} \\ \cline{2-11}
& \multicolumn{2}{c|}{\textbf{$t_{m}$}}
& \multicolumn{2}{c|}{\textbf{$s_{p}$}}
& \multicolumn{2}{c|}{\textbf{$o_{v}$}}
& \multicolumn{2}{c|}{\textbf{$l_{ft}$}}
& \multicolumn{2}{c|}{\textbf{$l_{ot}$}} \\
\cline{2-11}
& \textbf{$\vec{DQV}$}
& \textbf{$\vec{IQV}$}
& \textbf{$\vec{DQV}$}
& \textbf{$\vec{IQV}$}
& \textbf{$\vec{DQV}$}
& \textbf{$\vec{IQV}$}
& \textbf{$\vec{DQV}$}
& \textbf{$\vec{IQV}$}
& \textbf{$\vec{DQV}$}
& \textbf{$\vec{IQV}$} \\
\cline{2-11}
& \textbf{\{$i_{inc}$\}}
& \textbf{\{$cd_{err},ed_{coh}$\}}
& \textbf{\{$i_{inc}$\}}
& \textbf{\{$cd_{err},ed_{coh}$\}}
& \textbf{\{$i_{inc}$\}}
& \textbf{\{$cd_{err},ed_{coh}$\}}
& \textbf{\{$i_{inc}$\}}
& \textbf{\{$cd_{err},ed_{coh}$\}}
& \textbf{\{$i_{inc}$\}}
& \textbf{\{$cd_{err},ed_{coh}$\}} \\
\hline
\textbf{Normal} & \{false\} & \{false,0\} & \{false\} & \{false,2\} & \{false\} & \{false,2\} & \{false\} & \{false,0\} & \{false\} & \{false,0\} \\ \hline
\textbf{Port scan} & \{false\} & \{false,0\} & \{false\} & \{false,2\} & \{false\} & \{false,2\} & \{false\} & \{false,0\} & \{false\} & \{false,0\} \\ \hline
\textbf{PLC STOP} & \{false\} & \{false,\textbf{18}\} & \{\textbf{true}\} & \{\textbf{true,50}\} & \{\textbf{true}\} & \{\textbf{true,50}\} & \{false\} & \{false,\textbf{-2}\} & \{false\} & \{false,\textbf{-2}\} \\ \hline
\textbf{MITM attack on $s_{p}$} & \{false\} & \{\textbf{true},\textbf{29}\} & \{false\} & \{false,\textbf{50}\} & \{false\} & \{false,\textbf{50}\} & \{false\} & \{false,\textbf{-2}\} & \{false\} & \{false,\textbf{-2}\} \\ \hline
\textbf{MITM attack on $o_{v}$} & \{false\} & \{false,\textbf{-13}\} & \{false\} & \{false,2\} & \{false\} & \{false,\textbf{50}\} & \{false\} & \{false,0\} & \{false\} & \{false,0\} \\ \hline
\end{tabular}
\label{tab4}
\end{center}
\end{table*}
\end{document}
Thanks for your help.
C{...}
rather usec
, table will nicer fit on the page and columns will become centered in columns (now are spill out due to small column widths).\usepackage{multirow}
and I fixed the syntax of the\multirow
directive.