为什么 s12 行和 s1n 行之间没有虚线,就像 s22 列和 s2m 列之间没有虚线一样?正常情况下应该有。我做错了什么?谢谢!!
\documentclass[a4paper, fontsize=11pt]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{amsmath} % Mathematik
\usepackage{amssymb} % Mathematik
\usepackage{multirow,array}
\usepackage{arydshln}
\begin{document}
\begin{table}
\setlength{\extrarowheight}{2pt}
\begin{tabular}{*{6}{c|}} % Anzahl Spalten
\multicolumn{2}{c}{} & \multicolumn{4}{c}{Spieler $2$} \\ \cline{3-4} \cdashline{5-5} \cline{6-6}
\multicolumn{1}{c}{} & & $s_{21}$ & $s_{22}$ & $\hspace{0.3in}$ & $s_{2m}$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
\multirow{4}*{Spieler $1$}
& $s_{11}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
& $s_{12}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
\multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
& $s_{1n}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
\end{tabular}
\end{table}
\end{document}
答案1
像这样
您可以使用\multicolumn{1}{c:}{}
垂直虚线作为分隔符来创建行。
要控制虚线段之间的间隙,您可以修改长度,\dashlinegap
默认值为 4pt
代码
\documentclass[a4paper, fontsize=11pt]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multirow,array}
\usepackage{arydshln}
\dashlinegap=2pt
\begin{document}
\begin{table}
\setlength{\extrarowheight}{2pt}
\begin{tabular}{*{6}{c|}}
\multicolumn{2}{c}{} & \multicolumn{4}{c}{Spieler $2$} \\ \cline{3-4} \cdashline{5-5} \cline{6-6}
\multicolumn{1}{c}{} & & $s_{21}$ & $s_{22}$ & $\hspace{0.3in}$ & $s_{2m}$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
\multirow{4}*{Spieler $1$}
& $s_{11}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
& $s_{12}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
\multicolumn{1}{c:}{\vbox to 1cm{}} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
& $s_{1n}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5}
\cline{6-6}
\end{tabular}
\end{table}
\end{document}
答案2
请看截图——这是您想要实现的吗?
\cline{...} \cdashline{...} \cline{...}
将打印实线 | 虚线 | 实线。如果该线应从第 2 列到第 6 列为虚线,则使用\cdashline{2-6}
并删除\cline{...}
语句。
空行可以更容易地实现\multicolumn{6}{c}{} \tabularnewline
\documentclass[a4paper, fontsize=11pt]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{amsmath} % Mathematik
\usepackage{amssymb} % Mathematik
\usepackage{multirow,array}
\usepackage{arydshln}
\begin{document}
\begin{table}
\setlength{\extrarowheight}{2pt}
\begin{tabular}{*{6}{c|}} % Anzahl Spalten
\multicolumn{2}{c}{} & \multicolumn{4}{c}{Spieler $2$} \\ \cline{3-4} \cdashline{5-5} \cline{6-6}
\multicolumn{1}{c}{} & & $s_{21}$ & $s_{22}$ & $\hspace{0.3in}$ & $s_{2m}$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
\multirow{4}*{Spieler $1$}
& $s_{11}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
& $s_{12}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\
\cdashline{2-6}%
\multicolumn{6}{c}{} \tabularnewline
\cdashline{2-6}
& $s_{1n}$ & $(x,y)$ & $(x,y)$ & ${}$ & $(x,y)$ \\ \cline{2-4} \cdashline{5-5} \cline{6-6}
\end{tabular}
\end{table}
\end{document}