3

My current table is not so nice. The space is too tight. How to make this table nicer?

\documentclass{article}
\usepackage{comment}
\usepackage{mathtools} % for \smashoperator macro
\newcommand\tbc{{\textstyle\bigcup}} % handy shortcut macro
%\usepackage[table]{xcolor}

\usepackage{nicematrix}


\begin{document}

\begin{table}[!ht]
\centering
\caption{Semantic models of the OCCR model}
\scriptsize
\begin{tabular}{|m{2.5cm}<{\centering}|m{1.6cm}<{\centering}|m{8cm}<{\centering}|}
\hline
\textbf{Models}& \textbf{Symbol} & \textbf{Description}  
\\
\hline 
Reconfiguration& AS & Asset information in the manufacturing domain, such as hardware (equipment and tooling), software, the human workforce, and enabling technologies for achieving reconfiguration. 

\\ 
\hline Capacity model& CM &   A structured representation of manufacturing KPIs that monitor the performance state on the shop floor focusing on the reconfiguration. 
\\ 
\hline

\end{tabular}
\label{table:semantic models of OCCR model}
\end{table}

\end{document}

enter image description here

3 Answers 3

11

You ask how to make the table nicer. So

  1. remove all vertical rules that have no usefulness;
  2. use top alignment, there's no need for vertically center the entries;
  3. replace rules in the middle with vertical space;
  4. use tabularx in order to fill the text width and don't worry about computing widths.
\documentclass{article}
\usepackage{caption}
\usepackage{booktabs,tabularx}

\begin{document}

\begin{table}[!htp]
\centering

\caption{Semantic models of the OCCR model}
\label{table:semantic models of OCCR model}

%\scriptsize

\begin{tabularx}{\textwidth}{@{} l c X @{}}
\toprule
Models & Symbol & Description \\
\midrule
Assets & AS &
  Asset information in the manufacturing domain, such as hardware
  (equipment and tooling), software, the human workforce, and enabling
  technologies for achieving reconfiguration. 
\\
\addlinespace
Capacity model & CM &
  A structured representation of manufacturing KPIs that monitor the
  performance state on the shop floor focusing on the reconfiguration. 
\\ 
\bottomrule
\end{tabularx}

\end{table}

\end{document}

Why caption? Because it makes top captions well separated from the table (the standard classes are set up for bottom captions).

The \label is better placed next to the relevant \caption.

enter image description here

You can have vertical centering, but I don't recommend it.

\documentclass{article}
\usepackage{caption}
\usepackage{booktabs,tabularx}

\begin{document}

\begin{table}[!htp]
\centering

\caption{Semantic models of the OCCR model}
\label{table:semantic models of OCCR model}

%\scriptsize
\renewcommand{\tabularxcolumn}{m}

\begin{tabularx}{\textwidth}{@{} l c X @{}}
\toprule
Models & Symbol & Description \\
\midrule
Assets & AS &
  Asset information in the manufacturing domain, such as hardware
  (equipment and tooling), software, the human workforce, and enabling
  technologies for achieving reconfiguration. 
\\
\addlinespace
Capacity model & CM &
  A structured representation of manufacturing KPIs that monitor the
  performance state on the shop floor focusing on the reconfiguration. 
\\ 
\bottomrule
\end{tabularx}

\end{table}

\end{document}

enter image description here

By the way, your \tbc command should be

\newcommand{\tbc}{\mathop{\textstyle\bigcup}}

or the symbol wouldn't have the properties of a math operator as regards to spacing.

3
  • How to put the text in all columns in the middle? Thanks a lot!
    – James
    Feb 3 at 12:30
  • 1
    @James Do you need it? It would make the table less readable. See the comparison.
    – egreg
    Feb 3 at 12:54
  • Yes, I think I need it cause I have a multi-column in my case. I need to use multi rows in symbols. So I need to put the content in model in the middle
    – James
    Feb 3 at 14:40
7

You are loosing a lot of space for your first two columns. If you make them smaller, you have more room for the long description and you can even use a bigger font, which will be nicer to read:

\documentclass{article}
\usepackage{comment}
\usepackage{mathtools} % for \smashoperator macro
\newcommand\tbc{{\textstyle\bigcup}} % handy shortcut macro
%\usepackage[table]{xcolor}

\usepackage{nicematrix}

\usepackage{caption}
\usepackage{tabularray}


\begin{document}

\begin{table}[!ht]
\centering
\caption{Semantic models of the OCCR model}
\small
\begin{tblr}{
  colspec={|Q[c,1.4cm]|c|X[c]|},
  row{1}={font=\bfseries},
  cells={valign=m}
}
\hline
Models& Symbol & Description\\
\hline 
Re\-con\-fig\-uration& AS & Asset information in the manufacturing domain, such as hardware (equipment and tooling), software, the human workforce, and enabling technologies for achieving reconfiguration.\\ 
\hline Capacity model& CM &   A structured representation of manufacturing KPIs that monitor the performance state on the shop floor focusing on the reconfiguration.\\ 
\hline
\end{tblr}
\label{table:semantic models of OCCR model}
\end{table}

\end{document}

enter image description here

2
  • I have slightly changed my original table. Could you please have a look at my updated question? Thanks.
    – James
    Feb 3 at 11:49
  • @James Updated.. Feb 3 at 11:54
5
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{table}
\centering
\caption{Semantic models of the OCCR model}
\label{table:semantic models of OCCR model}
\begin{tblr}
{
colspec    = {Q[c,m]Q[c,m]X[l,m]},
hlines,vlines,
rows       = {font=\small},
row{1}     = {font=\bfseries},
cell{1}{Z} = {}{halign=c}
}
Models          & Symbol & Description                                                                                                                                                                      \\
Reconfiguration & AS     & Asset information in the manufacturing domain, such as hardware (equipment and tooling), software, the human workforce, and enabling technologies for achieving reconfiguration. \\
Capacity model  & CM     & A structured representation of manufacturing KPIs that monitor the performance state on the shop floor focusing on the reconfiguration.                                          \\
\end{tblr}
\end{table}
\end{document}

enter image description here

2
  • I have slightly changed my original table. Could you please have a look at my updated question? Thanks.
    – James
    Feb 3 at 11:49
  • 1
    @James I have updated. But your modification does not change the format of the table. You can replace the modified words directly.
    – Clara
    Feb 3 at 11:55

You must log in to answer this question.

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