Graphics, Figures & Tablesmultirow | Problem with Alignment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
dabd
Posts: 5
Joined: Sun Nov 09, 2008 12:49 pm

multirow | Problem with Alignment

Post by dabd »

Hi,

I am trying to create a table with some long urls like this:

Code: Select all

\begin{table}[tp] %
\label{table2}\centering %
\begin{tabular}{p{2cm}p{6cm}p{5cm}}
% \toprule %
\toprule
Col1 & Col2 & Col3 \\\toprule
Some text & \url{http://someurl} & Some text. \\\midrule
\multirow{2}{*}{Some common text} & \url{http://somelongurlsom.elongurlsome.longurlso.melon.gurlsomel.ongurlsome.longurlsomelongurlsom.elongurlsomelongurl} & Some text.\\\cline{2-3}
& \url{http://somelongurlsomelongurls.omelongu.rlsomelongur.lsomelongurlsomelongurl.somelongurlsomelo.ngur.lsomelongurl} & Some text.\\\bottomrule
\end{tabular}
\end{table}

But the "Some common text" cell is not aligned with the rest of the row. How can I keep the entire row aligned (to the top)?

Thank you.
Last edited by dabd on Tue Jun 21, 2011 6:49 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

multirow | Problem with Alignment

Post by fatra2 »

Hi there,

My solution is not the perfect one, since it is not automatic. I would say it is a bit more of a workaround than a solution.

When declaring your multirow, use the fixup option. The fixup is a length used for fine tuning: The text will be raised (or lowered, if fixup is negative) by that length above (below) wherever it would otherwise have gone.

Once you have your table ready, try adding this fixup length. With your example, I tried with a fixup of 7, which seems to work for me. Here is the code:

Code: Select all

\multirow{2}{*}[7]{Some common text} & \url{http://somelongurlsom.elongurlsome.longurlso.melon.gurlsomel.ongurlsome.longurlsomelongurlsom.elongurlsomelongurl} & Some text.\\\cline{2-3}
Hope this helps. Cheers
dabd
Posts: 5
Joined: Sun Nov 09, 2008 12:49 pm

multirow | Problem with Alignment

Post by dabd »

fatra2 wrote:Hi there,

My solution is not the perfect one, since it is not automatic. I would say it is a bit more of a workaround than a solution.

When declaring your multirow, use the fixup option. The fixup is a length used for fine tuning: The text will be raised (or lowered, if fixup is negative) by that length above (below) wherever it would otherwise have gone.

Once you have your table ready, try adding this fixup length. With your example, I tried with a fixup of 7, which seems to work for me. Here is the code:

Code: Select all

\multirow{2}{*}[7]{Some common text} & \url{http://somelongurlsom.elongurlsome.longurlso.melon.gurlsomel.ongurlsome.longurlsomelongurlsom.elongurlsomelongurl} & Some text.\\\cline{2-3}
Hope this helps. Cheers
I actually solved it by not using multirow! Anyway thanks for the help.
I am using normal rows and I get the desired alignment.
Post Reply