Tabelle konnte nicht mit dem Text im Absatz ausgerichtet werden

Tabelle konnte nicht mit dem Text im Absatz ausgerichtet werden

Ich habe eine Tabelle in meinem Dokument, aber sie sieht wirklich so hässlich aus, da die Tabelle nicht vertikal mit dem Text ausgerichtet ist. Sie können den Screenshot und meinen Versuch sehen. Bildbeschreibung hier eingeben

Versuchen:

\mbox{}\vskip1cm
\begin{table}[t]
\centering\setcellgapes{3pt}\makegapedcells
\captionsetup{format=hang}
\setlength\tabcolsep{3.5pt}%\small
\begin{tabular}{|c|c|c|c|}
        \cline{2-4}
    \multicolumn{1}{c|}{} & \makecell{Application Layer\\Layer 7} & \makecell{Transport \& Network Layer\\Layer 4 \& 3} & \makecell{Data Link \& Physical Layer\\Layer 2 \& 1}\\
    \hline
    WAN & IEC 62056/COSEM & TCP/IP & \makecell{IEC 62056/COSEM\\ PLC G3\\Fibre VLAN}\\
       \hline
    HAN & \makecell{ZigBee Smart Energy 1.0/2.0\\EN 13757-3 M-Bus\\IEC 62056/COSEM\\EN 50090-3} & \makecell{ZigBee 2.0\\EN 50090-4} & \makecell{ZigBee\\PLC\\EN 13757-2 M-Bus\\EN 50090-4}\\
     \hline
    \end{tabular}
    \caption{The standardization bodies CEN, CENELEC and ETSI identify smart metering European data exchange and communication standards which are categorized by depending on the network layer model and the network size.}
    \label{table:standards}
   \end{table}

In addition, the CEN/CENELEC TC 205 technical committee ....

Kann mir bitte jemand helfen, meine Tabelle am Text auszurichten? Das ist ein wirklich wichtiges Problem für mich, da ich mit anderen Tabellen ähnliche Probleme habe.

Antwort1

Sie können tabularxeine Linie zu einer der Zellen hinzufügen. Ich würde auch vorschlagen, für ein professionelleres Aussehen keine vertikalen Linien zu verwenden, sondern die Linien mit variabler Dicke von booktabs, die eine vertikale Polsterung um die Linien herum hinzufügen.

Hier ist ein Beispiel für beides:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{array, makecell, caption, tabularx, booktabs}
\renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}p{#1}}
\renewcommand\cellalign{tc}

\begin{document}
\mbox{}\vspace{1cm}
\begin{table}[!htb]
\centering\setcellgapes{3pt}\makegapedcells
\captionsetup{format=hang}
\setlength\tabcolsep{3.5pt}%\small
\begin{tabularx}{\linewidth}{|c|X|X|X|}
    \cline{2-4}
\multicolumn{1}{c|}{} & \makecell{Application Layer\\Layer 7} & \makecell{Transport \& Network Layer\\Layer 4 \& 3} & \makecell{Data Link \& Physical Layer\\Layer 2 \& 1}\\
\hline
WAN & IEC 62056/COSEM & TCP/IP &\makecell{[IEC 62056/COSEM\\ PLC G3\\Fibre VLAN}\\
   \hline
HAN & \makecell{ZigBee \\Smart Energy 1.0/2.0\\EN 13757-3 M-Bus\\IEC 62056/COSEM\\EN 50090-3} & \makecell{ZigBee 2.0\\EN 50090-4} & \makecell{ZigBee\\PLC\\EN 13757-2 M-Bus\\EN 50090-4}\\
 \hline
\end{tabularx}
\caption{The standardization bodies CEN, CENELEC and ETSI identify smart metering European data exchange and communication standards which are categorized by depending on the network layer model and the network size.}
\label{table:standards}
\end{table}

In addition, the CEN/CENELEC TC 205 technical committee ....

\begin{table}[!htb]
\centering\setcellgapes{3pt}\makegapedcells
\captionsetup{format=hang}
\setlength\tabcolsep{3.5pt}%\small
\begin{tabularx}{\linewidth}{cXXX}
    \cmidrule[\heavyrulewidth]{2-4}
& \makecell{Application Layer\\Layer 7} & \makecell{Transport \& Network Layer\\Layer 4 \& 3} & \makecell{Data Link \& Physical Layer\\Layer 2 \& 1}\\
\cmidrule{2-4}
WAN & IEC 62056/COSEM & TCP/IP &\makecell{[IEC 62056/COSEM\\ PLC G3\\Fibre VLAN}\\
   \addlinespace
HAN & \makecell{ZigBee \\Smart Energy 1.0/2.0\\EN 13757-3 M-Bus\\IEC 62056/COSEM\\EN 50090-3} & \makecell{ZigBee 2.0\\EN 50090-4} & \makecell{ZigBee\\PLC\\EN 13757-2 M-Bus\\EN 50090-4}\\
    \cmidrule[\heavyrulewidth]{2-4}
\end{tabularx}
\caption{The standardization bodies CEN, CENELEC and ETSI identify smart metering European data exchange and communication standards which are categorized by depending on the network layer model and the network size.}
\label{table:standards}
\end{table}
\end{document} 

Bildbeschreibung hier eingeben

verwandte Informationen