2017-03-03 2 views
0

テーブルを作成し、すべてのケースの真ん中にテキストを印刷したいと思います。私は、アレイパッケージを使用して、私は書いた:ラテックス上のテーブルの縦方向の整列

\begin{table}[H] 
\begin{center} 
\begin{tabular}{|m{3cm}|m{2.5cm}|m{2.5cm}|m{2.5cm}|m{6cm}|} 

しかし、その後ラテックスは、私は私のテーブル内の1つの「$」または1つを「{」逃したと言う...しかし、唯一のテキストがあるので、私は理解していません。私がスイッチしたとき:

\begin{table}[H] 
\begin{center} 
\begin{tabular}{|m{3cm}|C{2.5cm}|C{2.5cm}|C{2.5cm}|C{6cm}|} 

すべてが問題なく動作しています...しかし、それは醜いです。私はサイト上でそれについてたくさんのものを既に読んでいましたが、私のはっきりしたような問題を決して決して決してしませんでした:/

+0

[StackExchange上の別の質問の重複(http://tex.stackexchange.com/questions/7208/how-to-vertically-center-the-text-of-the-細胞) – Yehia

答えて

0

私がテーブルに使うレイアウトの最小の例です。 サイジングと書式の組み合わせが異なります。 これがあなたが求めているものかどうかはわかりません。あなたの質問を、もしそうでなければ改革してください。

\documentclass{scrartcl} 

\usepackage{booktabs} % \cmidrule in tables 
% \usepackage{caption} % Nice Captions 
% \usepackage{longtable} % Tables larger than one page 
% \usepackage{multirow} % Mergings Cells 
% \usepackage{multicol} % Merging Cells 
\usepackage{tabularx} 

\begin{document} 
\begin{table} 
    \caption{Some caption, for tables always above} 
    \label{some label} 
    \begin{tabularx}{0.99\textwidth}{>{\centering}X>{\raggedleft}X>{\raggedleft}X>{\raggedleft}p{0.5cm}>{\raggedleft}p{3cm}>{\raggedright}X>{\raggedleft\arraybackslash}X} 
    \toprule 
    \textsc{Foobar} & $a$ & $b$ & $c$ & $d$ & $e$ & $f$ \\ 
    \cmidrule(r){1-1} \cmidrule(lr){2-2} \cmidrule(lr){3-3} \cmidrule(lr){4-4} \cmidrule(lr){5-5} \cmidrule(lr){6-6} \cmidrule(l){7-7} 
    1    & 2 & 2 & 2 & 2 & 2 & 2 \\ 
    2    & 4 & 5 & 4 & 4 & 4 & 4 \\ 
    3    & 4 & 3 & 4 & 3 & 3 & 3 \\ 
    \bottomrule 
    \end{tabularx} 
\end{table} 
\end{document} 

PDF

関連する問題