Graphics, Figures & TablesNon-centered cells in table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Non-centered cells in table

Post by Kotoschow »

Hello everyone,

I'm trying to no avail to create a table every cell in the row starts at the same height. Right now, every two cells in a row are centralized with respect to each other. So instead of:

Code: Select all

       Col1|Col2
  Row1|    |bla
      |bla |bla
      |    |bla
I want:

Code: Select all

       Col1|Col2
  Row1|bla |bla
      |    |bla
      |    |bla
That is, the first line in every cell in the row starts at the same level.
Suggestions anyone?
Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Non-centered cells in table

Post by Johannes_B »

What you want is the LaTeX standard for p-columns. Are you using m-clumns by any chance? Don't.

To really help you, we need to see a minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Non-centered cells in table

Post by Kotoschow »

Okay I tried p-columns and it solved my original problem but now it turns out I have a new problem: the table itself is centered with respect to the

Code: Select all

\item
in a list. I provide a MWE which demonstrates this. This MWE produces a list with a table such that the table is centered with respect to the item label. However I want all of them to appear in the same line.

Code: Select all

\documentclass{article}

\begin{document}

\begin{enumerate}
\item \begin{tabular}{p{2pt}p{5cm}}
* & This curriculum vitae template has been designed for an academic CV. The current structure provides a summary of academic history without going in-depth on any one constituent part but the  \\

\end{tabular}
\end{enumerate}

\end{document}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Non-centered cells in table

Post by Johannes_B »

Very good example, the tabular is a box and gets typeset with its vertical center aligned with the baseline of the surrounding text. Use the optional argument to get the top of the box aligned.

Code: Select all

\documentclass{article}

\begin{document}

\begin{enumerate}
	\item \begin{tabular}[t]{p{2pt}p{5cm}}
			* & This curriculum vitae template has been designed for
			an academic CV. The current structure provides a summary
			of academic history without going in-depth on any one
			constituent part but the
		\end{tabular}
\end{enumerate}

\end{document}
I hope you are not designing a template. By the way, what is your definition of a template? Personally, i am very confused.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Re: Non-centered cells in table

Post by Kotoschow »

Sorry sorry sorry this text is just a filler! it has no meaning.

Anyway it worked, thanks a lot.
Post Reply