General ⇒ placing text in the center of the row
-
- Posts: 58
- Joined: Sun Apr 27, 2008 12:50 pm
placing text in the center of the row
I have created the table, where is the text in each row defaultly placed on the bottom. I need it in the middle. Any ide how?
cheers
a.k.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
placing text in the center of the row
you could use m-columns of the array package, like this example:
Code: Select all
\usepackage{array}
...
\begin{tabular}{m{1cm}m{1.5cm}}
text & long text, two lines
\end{tabular}
-
- Posts: 58
- Joined: Sun Apr 27, 2008 12:50 pm
Re: placing text in the center of the row
It works ok now. But how to center the columns now?
a.k.
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: placing text in the center of the row
you wrote that you don't want the text at the bottom, you want it to be centered. So I understood you meant vertically centered.
Cells in m-columns are centered vertically. Table formatting is done by columns, not by rows.
Perhaps show us your table code to clarify. We will look then what we can change there.
Stefan
-
- Posts: 58
- Joined: Sun Apr 27, 2008 12:50 pm
Re: placing text in the center of the row
After applying what you have suggested I have text in the centre of the row but not column (it is now aligned to the left)
Here it is:
\begin{landscape}
\begin{table}[dp]
\centering
\begin{tabular}{m{1cm}m{6cm}m{6cm}m{2.2cm}m{2.2cm}}
\hline
& {\bf Fibre} & {\bf Laser spot} & {\bf Focus depth ($\mu$m)} & {\bf Peak position (nm)}\\
\hline\hline
a) & \includegraphics[scale=0.3]{DA} & \includegraphics[scale=0.3]{DB} & +20 & 647.485\\
b) & \includegraphics[scale=0.3]{BA} & \includegraphics[scale=0.3]{BB} & 0 & 647.514\\
c) & \includegraphics[scale=0.3]{CA} & \includegraphics[scale=0.3]{CB} & -20 & 647.542\\
\hline
\end{tabular}
\caption[Influence of focusing on the position of the 648 nm luminescence band.]{\textbf{Influence of focusing on the position of the 648 nm luminescence band.}}
\label{tab6-3}
\end{table}
\end{landscape}
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
placing text in the center of the row
Code: Select all
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
Code: Select all
\begin{tabular}{M{1cm}M{6cm}M{6cm}M{2.2cm}M{2.2cm}}
-
- Posts: 58
- Joined: Sun Apr 27, 2008 12:50 pm
Re: placing text in the center of the row
a.k.