Graphics, Figures & TablesTable text alignment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
helpmeoverleaf96
Posts: 2
Joined: Fri Mar 12, 2021 3:29 pm

Table text alignment

Post by helpmeoverleaf96 »

Hi guys,

Currently working on my thesis in overleaf, and I am having some troubles with a table. (def not a table pro over here) I would like the text in the left column to align with the top of the right column, and I just cannot get it to work.
My code looks like this

Code: Select all

\begin{tabular}{p{8em} m{30em}}
\hline
\textbf{SDS-PAGE Electrophoresis Buffer} &  was prepared by diluting NuPAGE\textregistered MES SDS running buffer (20X) (Novex\textregistered, cat\# NP0002) into a 1X concentration with \acrshort{dm}. The electrophoresis buffer was prepared in advance and stored in a cold-room on a magnetic stirrer until use.  \\ 
\textbf{Blue Native PAGE Anode Buffer}  & was prepared by diluting NativePAGE™ Running Buffer (20X) (Invitrogen\textsuperscript{TM}, cat\# BN2001) into a 1X concentration with \acrshort{dm}. This buffer was prepared in advance and stored in a cold-room on a magnetic stirrer until use.   \\  
\hline
\end{tabular}
And it looks like this
Screenshot 2021-03-12 at 14.31.46.png
Screenshot 2021-03-12 at 14.31.46.png (46.19 KiB) Viewed 8641 times
I have tried with the p{8em}, because the overleaf help page suggests that this would "paragraph column with text vertically aligned at the top" - it doesn't. I've also tried the \vspace(-1cm) before the text, and this does not solve the problem either.

Please if anyone could help I'd be really grateful.
Thank you,

Kind regards, Mel :?

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Table text alignment

Post by Ijon Tichy »

Try changing \begin{tabular}{p{8em} m{30em}} into \begin{tabular}{p{8em}p{30em}}.

BTW: Please always post a Infominimal working example instead of a code snippet only. And please always mark your code as code using either the [Code] button of the toolbar or the [Select code] selector. With the [Select code] selector you can explicitly select code language TeX (LaTeX) and give your LaTeX file a suitable name. See the BBCode Help for more information about formatting your posts. In future the latex.org will provide a button to edit and compile code and show the result. But this cannot work, if you only show a code snippet or do not mark the code correctly.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
helpmeoverleaf96
Posts: 2
Joined: Fri Mar 12, 2021 3:29 pm

Table text alignment

Post by helpmeoverleaf96 »

Thank you so much, that solved it! :D I will do that if I need help in the future. Again, thank you so much.
Post Reply