我使用了很多(简单的)表格。不幸的是,最后一列总是有点不整齐:文本比其他列高几毫米,刚好足以让人注意到。如何在表格中水平和垂直均匀地居中文本?
\documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2cm,footskip=1cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T2A,T1]{fontenc}
\usepackage{tipa}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{array,booktabs}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{N}{@{}m{0pt}@{}}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Analogie zwischen Phonologie und Graphematik}
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{ | M{4.9cm} | M{4.9cm} | M{4.9cm} | N }
\hline
&
\textit{Signifié} &
\textit{Signifiant} \\[5pt]
\hline
Sprechsprache &
\textipa{/a/} (Phonem) &
\textipa{[a]} (Phon) \\[5pt]
\hline
Schriftsprache &
\flq a\frq\space (Graphem) &
\textvertline a\textvertline\space (Graph) \\[5pt]
\hline
\end{tabular}
\label{phonographe}
\end{table}
\end{document}
\documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2cm,footskip=1cm]{geometry}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{caption}
\usepackage{filecontents}
\usepackage{lipsum}
\usepackage{array,booktabs}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\usepackage{lmodern}
\usepackage{CJKutf8}
\usepackage[footnote,printonlyused]{acronym}
\usepackage[utf8]{inputenc}
\usepackage[T2A,T1]{fontenc}
\usepackage[russian,ngerman]{babel}
\usepackage{tipa}
\usepackage{csquotes}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Konsonantische Alternationen bei der Pluralbildung}
\newcommand{\heightadjustment}{\rule[-12pt]{0pt}{2.5\normalbaselineskip}}
\begin{tabular}{ | M{2.7cm} | M{6cm} | M{6cm} | }
\hline
&
Singular &
Plural \\
\hline
\glqq Wolf\grqq &
\flq lup\frq\space\textipa{/lup/} \textipa{[lup]} &
\flq lupi\frq\space\textipa{/lupi/} \textipa{[lup\textsuperscript{j}]} \\[5pt]
\hline
\glqq Bär\grqq &
\flq urs\frq\space\textipa{/urs/} \textipa{[urs]} &
\flq urși\frq\space\textipa{/ursi/} \textipa{[urS\textsuperscript{j}]} \\[5pt]
\hline
\glqq Elefant\grqq &
\flq elefant\frq\space\textipa{/ElEfant/} \textipa{[ElEfant]} &
\flq elefanți\frq\space\textipa{/ElEfanti/} \textipa{[ElEfan\texttoptiebar{ts}\textsuperscript{j}]} \\[5pt]
\hline
\glqq junger Bock\grqq &
\flq ied\frq\space\textipa{/ied/} \textipa{[\textsubarch{i}ed]} &
\flq iezi\frq\space\textipa{/iedi/} \textipa{[\textsubarch{i}ez\textsuperscript{j}]} \\[5pt]
\hline
\glqq Krebs\grqq &
\flq rac\frq\space\textipa{/rak/} \textipa{[rak]} &
\flq raci\frq\space\textipa{/raki/} \textipa{[ra\texttoptiebar{tS}\textsuperscript{j}]} \\[5pt]
\hline
\glqq Hamster\grqq &
\flq hârciog\frq\space\textipa{/h\textbari r\texttoptiebar{tS}og/} \textipa{[h\textbari r\texttoptiebar{tS}og]} &
\flq hârciogi\frq\space \textipa{/h\textbari r\texttoptiebar{tS}ogi/} \textipa{[h\textbari r\texttoptiebar{tS}o\texttoptiebar{dZ}\textsuperscript{j}]} \\[5pt]
\hline
\end{tabular}
\label{konalt}
\end{table}
\end{document}
答案1
您希望对这样的表格使用p
(或) 列,以免丢失基线对齐。此外,您指定的宽度使表格比文本宽度更宽,因此我将它们缩小了一点。b
m
m
\documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2cm,footskip=1cm]{geometry}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{caption}
\usepackage{filecontents}
\usepackage{lipsum}
\usepackage{array,booktabs}
\newcolumntype{M}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{lmodern}
\usepackage{CJKutf8}
\usepackage[footnote,printonlyused]{acronym}
\usepackage[utf8]{inputenc}
\usepackage[T2A,T1]{fontenc}
\usepackage[russian,ngerman]{babel}
\usepackage{tipa}
\usepackage{csquotes}
\begin{document}
\begin{table}[htbp]
\centering
\setlength\extrarowheight{6pt}
\caption{Konsonantische Alternationen bei der Pluralbildung}
\begin{tabular}{ | M{2.7cm} | M{5.9cm} | M{5.9cm} | }
\hline
&
Singular &
Plural \\
\hline
\glqq Wolf\grqq &
\flq lup\frq\space\textipa{/lup/} \textipa{[lup]} &
\flq lupi\frq\space\textipa{/lupi/} \textipa{[lup\textsuperscript{j}]} \\[5pt]
\hline
\glqq Bär\grqq &
\flq urs\frq\space\textipa{/urs/} \textipa{[urs]} &
\flq urși\frq\space\textipa{/ursi/} \textipa{[urS\textsuperscript{j}]} \\[5pt]
\hline
\glqq Elefant\grqq &
\flq elefant\frq\space\textipa{/ElEfant/} \textipa{[ElEfant]} &
\flq elefanți\frq\space\textipa{/ElEfanti/} \textipa{[ElEfan\texttoptiebar{ts}\textsuperscript{j}]} \\[5pt]
\hline
\glqq junger Bock\grqq &
\flq ied\frq\space\textipa{/ied/} \textipa{[\textsubarch{i}ed]} &
\flq iezi\frq\space\textipa{/iedi/} \textipa{[\textsubarch{i}ez\textsuperscript{j}]} \\[5pt]
\hline
\glqq Krebs\grqq &
\flq rac\frq\space\textipa{/rak/} \textipa{[rak]} &
\flq raci\frq\space\textipa{/raki/} \textipa{[ra\texttoptiebar{tS}\textsuperscript{j}]} \\[5pt]
\hline
\glqq Hamster\grqq &
\flq hârciog\frq\space\textipa{/h\textbari r\texttoptiebar{tS}og/} \textipa{[h\textbari r\texttoptiebar{tS}og]} &
\flq hârciogi\frq\space \textipa{/h\textbari r\texttoptiebar{tS}ogi/} \textipa{[h\textbari r\texttoptiebar{tS}o\texttoptiebar{dZ}\textsuperscript{j}]} \\[5pt]
\hline
\end{tabular}
\label{konalt}
\end{table}
\end{document}
答案2
我们不用使用 来指定每行间距调整\\[<len>]
,而是可以为特定列的每个条目添加一个支柱。支柱可以在基线的上下垂直拉伸,以便根据需要精确拉伸行距:
\documentclass{article}
\usepackage{array}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\begin{document}
\newcommand{\heightadjustment}{\rule[-12pt]{0pt}{2.5\normalbaselineskip}}
\begin{tabular}{ | >{\heightadjustment}M{49mm} | M{49mm} | M{49mm} | }
\hline
& \textit{Something} & \textit{Something else} \\
\hline
Sprechsprache & (Phonem) & (Phon) \\
\hline
Schriftsprache & (Graphem) & (Graph) \\
\hline
\end{tabular}
\end{document}
以下是第一列中可视化的支柱(通过使用而不是1pt
的宽度获得):\rule
0pt