T*e
5 楼
I think what he meant is like this:
\begin{table}
\begin{tabular}[c]{|c|c|}
\hline
test & test \\[3mm]
\hline
\end{tabular}
\end{table}
everything is ok, except the text is not align vertical in the center of the
cell.
【在 j******d 的大作中提到】
: 好像不行啊.
: 用 \hline\\[1mm] blabla...
: 就算定义成 \begin{tabular}[c]{cc|cc},也无法让blabla在该行垂直中央(靠底部了).
: 还有,分隔竖线 | 不够高,那 1mm 没有分隔线.
\begin{table}
\begin{tabular}[c]{|c|c|}
\hline
test & test \\[3mm]
\hline
\end{tabular}
\end{table}
everything is ok, except the text is not align vertical in the center of the
cell.
【在 j******d 的大作中提到】
: 好像不行啊.
: 用 \hline\\[1mm] blabla...
: 就算定义成 \begin{tabular}[c]{cc|cc},也无法让blabla在该行垂直中央(靠底部了).
: 还有,分隔竖线 | 不够高,那 1mm 没有分隔线.
i*e
6 楼
yeah, this way works if he wanna change the row height for one or few r
ows.
I think he can make it at vertical center by putting different positive
or negtive values after "test" and upper and lower \hline.
\arraystretch might be what he wants actually, so he can change the heights
for all rows.
【在 T*******e 的大作中提到】
: I think what he meant is like this:
: \begin{table}
: \begin{tabular}[c]{|c|c|}
: \hline
: test & test \\[3mm]
: \hline
: \end{tabular}
: \end{table}
: everything is ok, except the text is not align vertical in the center of the
: cell.
ows.
I think he can make it at vertical center by putting different positive
or negtive values after "test" and upper and lower \hline.
\arraystretch might be what he wants actually, so he can change the heights
for all rows.
【在 T*******e 的大作中提到】
: I think what he meant is like this:
: \begin{table}
: \begin{tabular}[c]{|c|c|}
: \hline
: test & test \\[3mm]
: \hline
: \end{tabular}
: \end{table}
: everything is ok, except the text is not align vertical in the center of the
: cell.
T*e
7 楼
I also tried:
\begin{table}
\begin{tabular}[c]{|c|c|}
\hline&\\[0mm]
test & test \\[5mm]
\hline
\end{tabular}
\end{table}
it works, but the number in [] is hard to adjust so that the text is aligned
in center vertically.
【在 i******e 的大作中提到】
: yeah, this way works if he wanna change the row height for one or few r
: ows.
: I think he can make it at vertical center by putting different positive
: or negtive values after "test" and upper and lower \hline.
: \arraystretch might be what he wants actually, so he can change the heights
: for all rows.
\begin{table}
\begin{tabular}[c]{|c|c|}
\hline&\\[0mm]
test & test \\[5mm]
\hline
\end{tabular}
\end{table}
it works, but the number in [] is hard to adjust so that the text is aligned
in center vertically.
【在 i******e 的大作中提到】
: yeah, this way works if he wanna change the row height for one or few r
: ows.
: I think he can make it at vertical center by putting different positive
: or negtive values after "test" and upper and lower \hline.
: \arraystretch might be what he wants actually, so he can change the heights
: for all rows.
T*n
8 楼
Is this what you want? The "m" type columns center text vertically, but
since it allows multiple lines of text, you need to set the column width.
Remove the >{\centering} if you want double-flushed text, or change to
>{\raggedright} for left justification only.
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{tabular}{|>{\centering}m{72pt}|m{72pt}|}
\hline
The long text that is in the first column. &
Second column. \\
\hline
\end{tabular}
\end{document}
【在 j******d 的大作中提到】
: 觉得字填充了整行,有点挤.请教怎么设定行的高度,并且让字垂直居中.谢谢...
since it allows multiple lines of text, you need to set the column width.
Remove the >{\centering} if you want double-flushed text, or change to
>{\raggedright} for left justification only.
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{tabular}{|>{\centering}m{72pt}|m{72pt}|}
\hline
The long text that is in the first column. &
Second column. \\
\hline
\end{tabular}
\end{document}
【在 j******d 的大作中提到】
: 觉得字填充了整行,有点挤.请教怎么设定行的高度,并且让字垂直居中.谢谢...
i*e
10 楼
It seems that the first argument controls the whole row. {b{1in} m{1in}}
will make the texts of the whole row at the bottom, even if I use "m" f
or the second column; vice versa. ...... don't quite understand.
【在 T*******n 的大作中提到】
: Is this what you want? The "m" type columns center text vertically, but
: since it allows multiple lines of text, you need to set the column width.
: Remove the >{\centering} if you want double-flushed text, or change to
: >{\raggedright} for left justification only.
: \documentclass{article}
: \usepackage{array}
: \begin{document}
: \begin{tabular}{|>{\centering}m{72pt}|m{72pt}|}
: \hline
: The long text that is in the first column. &
will make the texts of the whole row at the bottom, even if I use "m" f
or the second column; vice versa. ...... don't quite understand.
【在 T*******n 的大作中提到】
: Is this what you want? The "m" type columns center text vertically, but
: since it allows multiple lines of text, you need to set the column width.
: Remove the >{\centering} if you want double-flushed text, or change to
: >{\raggedright} for left justification only.
: \documentclass{article}
: \usepackage{array}
: \begin{document}
: \begin{tabular}{|>{\centering}m{72pt}|m{72pt}|}
: \hline
: The long text that is in the first column. &
T*n
11 楼
That is the correct behavior. The first column has three lines of text, and
by setting it as a "b" column, you are telling LaTeX to set the vertical
alignment reference position to the bottom of the first column. The second
column has only one single line, so the vertical alignment reference position
is that single line itself. Therefore the result is that the single line in
the second column aligned with the last line in the first column.
You should normally set the column containing the cel
【在 i******e 的大作中提到】
: It seems that the first argument controls the whole row. {b{1in} m{1in}}
: will make the texts of the whole row at the bottom, even if I use "m" f
: or the second column; vice versa. ...... don't quite understand.
by setting it as a "b" column, you are telling LaTeX to set the vertical
alignment reference position to the bottom of the first column. The second
column has only one single line, so the vertical alignment reference position
is that single line itself. Therefore the result is that the single line in
the second column aligned with the last line in the first column.
You should normally set the column containing the cel
【在 i******e 的大作中提到】
: It seems that the first argument controls the whole row. {b{1in} m{1in}}
: will make the texts of the whole row at the bottom, even if I use "m" f
: or the second column; vice versa. ...... don't quite understand.
i*e
12 楼
huhu, don't quite understand. I'll try to figure out the example back ho
me. Thanks
position
【在 T*******n 的大作中提到】
: That is the correct behavior. The first column has three lines of text, and
: by setting it as a "b" column, you are telling LaTeX to set the vertical
: alignment reference position to the bottom of the first column. The second
: column has only one single line, so the vertical alignment reference position
: is that single line itself. Therefore the result is that the single line in
: the second column aligned with the last line in the first column.
: You should normally set the column containing the cel
me. Thanks
position
【在 T*******n 的大作中提到】
: That is the correct behavior. The first column has three lines of text, and
: by setting it as a "b" column, you are telling LaTeX to set the vertical
: alignment reference position to the bottom of the first column. The second
: column has only one single line, so the vertical alignment reference position
: is that single line itself. Therefore the result is that the single line in
: the second column aligned with the last line in the first column.
: You should normally set the column containing the cel
T*n
13 楼
Each cell in the table has its own vertical alignment reference point,
and all the cells in the same row have their vertical alignment reference
points aligned with each other. The vertical alignment of these cells
work the same way as \parbox's.
Maybe this helps illustrate the alignment mechanism?
\documentclass[landscape]{article}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{9in}
\begin{document}
\makebox[0pt][l]{\rule{\textwidth}{0.2pt}}
\ignorespaces
vertical alignment reference l
【在 i******e 的大作中提到】
: huhu, don't quite understand. I'll try to figure out the example back ho
: me. Thanks
:
: position
and all the cells in the same row have their vertical alignment reference
points aligned with each other. The vertical alignment of these cells
work the same way as \parbox's.
Maybe this helps illustrate the alignment mechanism?
\documentclass[landscape]{article}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{9in}
\begin{document}
\makebox[0pt][l]{\rule{\textwidth}{0.2pt}}
\ignorespaces
vertical alignment reference l
【在 i******e 的大作中提到】
: huhu, don't quite understand. I'll try to figure out the example back ho
: me. Thanks
:
: position
i*e
14 楼
Thanks! Actually I got what you were saying during driving back home. :)
【在 T*******n 的大作中提到】
: Each cell in the table has its own vertical alignment reference point,
: and all the cells in the same row have their vertical alignment reference
: points aligned with each other. The vertical alignment of these cells
: work the same way as \parbox's.
: Maybe this helps illustrate the alignment mechanism?
: \documentclass[landscape]{article}
: \setlength{\oddsidemargin}{0in}
: \setlength{\textwidth}{9in}
: \begin{document}
: \makebox[0pt][l]{\rule{\textwidth}{0.2pt}}
【在 T*******n 的大作中提到】
: Each cell in the table has its own vertical alignment reference point,
: and all the cells in the same row have their vertical alignment reference
: points aligned with each other. The vertical alignment of these cells
: work the same way as \parbox's.
: Maybe this helps illustrate the alignment mechanism?
: \documentclass[landscape]{article}
: \setlength{\oddsidemargin}{0in}
: \setlength{\textwidth}{9in}
: \begin{document}
: \makebox[0pt][l]{\rule{\textwidth}{0.2pt}}
相关阅读
请教latex中文的输入TeX4ht求教如何让一个命令根据所处的环境输出不同的内容?nomenclature如何分组?dvipdf生成的pdf标题/footnote都很虚?终于把我老婆convert成tex user了,呵呵向大牛紧急求助:新版latex里面怎么弄hyperref???latex的精髓就在于latex图片位置问题如何改变标题字体大小请问TexnicCenter有没有“收起”功能?listings 的参数设置请教PDF防复制加密怎么可以要2*2矩阵不居中?我的Yap (DVI查看器)究竟出了什么问题latex 的图不在该出现的地方出现怎么办?求助:Acrobat 9保存的PDF图片无法用pdflatex插入问个Biblion中的url链接的问题公式编号前面怎么加入一个字母?请问怎么在一个符号的下面加注解?