
Ich habe eine Tabelle erstellt, die wie das Bild unten aussieht, aber ich bin mir nicht sicher, ob das in Ordnung ist oder nicht. Ich meine, warum wird nach den ersten Zeilen der beiden Zeilen eine Zeilenlücke angezeigt? Ich habe sie rot markiert. Oder ist das das richtige Verhalten? Kann mir das bitte jemand sagen? Ich habe meinen Code hier hinzugefügt.
\begin{table}[htbp]
\centering
\caption{Summary of the comparison with existing approaches}
\label{tab:Testing Results}
\begin{tabular}{|p{.30 cm}|p{2.2cm}|l|l|l|}
\hline
\multicolumn{2}{|p{2.5cm}|} {\diagbox { }{Approach}}&Lizhi [4]&Yuan [9]&Our Approach\\\hline
CS1 & Total Paths &6 &10 &3\\ \cline{2-5}
& Feasible Paths &6 &3 &3\\ \cline{2-5}
& Infeasible Paths &0 &7 &0 \\\hline
CS2 & Total Paths &35 &6 &1\\ \cline{2-5}
& Feasible Paths &35 &4 &1\\ \cline{2-5}
& Infeasible Paths &0 &2 &0 \\\hline
\end{tabular}
\end{table}
Antwort1
Vereinfachte Versionen der Tabelle mit weniger Zeilen und ausgerichteten Zahlen:
\documentclass{article}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{diagbox}
\usepackage{siunitx}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Summary of the comparison with existing approaches}
\label{tab:Testing Results}
\begin{tabular}{
l
l
S[table-format=2]
S[table-format=2]
S[table-format=1]
}
\toprule
& & \multicolumn{3}{c}{Approach}\\
\cmidrule{3-5}
& & {Lizhi [4]}&{Yuan [9]}&{Our approach}\\
\midrule
CS1 & Total paths &6 &10 &3\\
& Feasible paths &6 &3 &3\\
& Infeasible paths &0 &7 &0 \\
\addlinespace
CS2 & Total paths &35 &6 &1\\
& Feasible paths &35 &4 &1\\
& Infeasible paths &0 &2 &0 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Weitere Bemerkungen:
Eine Bibliographie kann auch mit LaTeX erstellt und
[4]
durch[9]
den Aufruf des Makros ersetzt werden\cite
.Ich sehe keinen Grund, Groß- und Kleinschreibung zu verwenden. Daher wird im Beispiel für die Einträge in der Tabelle die Groß- und Kleinschreibung von Sätzen verwendet.
Our approach
könnte auf gekürzt werdenOur
.