0

I have a table with two columns, the width of each column is set. There are cases where the left hand text is one line and the right hand text is two lines. As a result the left hand text is aligned with the white-space in between the two lines on the right hand side.

Is there anyway I can space it so the two top lines are level with the additional space just taken up as a blank line below the single left hand side value?

Markup:

\documentclass[10pt]{book}
\usepackage{subcaption}
\usepackage{url}
\usepackage{array}
\begin{document}
\begin{center}
  \begin{tabular}{| >{\centering\arraybackslash}m{5.4cm}  >{\centering\arraybackslash}m{5.4cm} |} 
  \hline
    Traditional Care & Technological Care\\
  \hline 
    Patient to keep a diary for appointments. & Automated calendar reminder to phone.\\
    Important items to be kept in the same place. & Alarmed receiver attached to important objects.\\
    Put labels on doors/cupboards. & Wearable camera to recognise and remind doors/cupboards.\\
    Place important numbers by the phone. & Phone with pre-stored numbers represented by familiar faces.\\
    Place note on back of door as reminder to take keys. & Door sensor to remind occupant to take keys when door is opened.\\
    Label family photographs. & Facial recognition to act as a reminder.\\
    Pin a weekly timetable to the wall. & Automated calendar reminder to phone/wall mounted monitor.\\
    Write reminders to lock door at night, turn off gas, put rubbish out etc. & Automated systems in house to turn off systems/lock doors at certain times, automated reminders.\\
  \hline
 \end{tabular}
   \captionof{table}{Comparison of differing provisions of care for ADL.}
     \label{tab:activityList}
\end{center}
\end{document}
7
  • You are much more likely to get help if you provide a full minimal example that people can copy and compile immediately without having to add stuff to it.
    – daleif
    Jul 20 '15 at 10:30
  • I thought the above code was enough, what is missing? The document class?
    – Colin747
    Jul 20 '15 at 10:32
  • yes and maybe other packages (e.g. caption) and \begin{document}\end{document}
    – LaRiFaRi
    Jul 20 '15 at 10:33
  • Didn't think I had to include \begin{document} etc. Updated the above code I am able to compile it with a copy/paste into a new doc. Let me know if there is any problems.
    – Colin747
    Jul 20 '15 at 10:35
  • 1
    @Colin747 in the version now, I can just copy and paste it into a blank doc and compile it. Less work for me, more time to help ;-)
    – daleif
    Jul 20 '15 at 11:19
2

You just have to replace the m-column (which centres vertically) by a p-column which aligns to the top.

Here is how I would set your table:

% arara: pdflatex

\documentclass[10pt]{book}
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{array}
\usepackage{ragged2e}
\usepackage{microtype}

\begin{document}
    \begin{table}
        \centering
        \begin{tabular}{>{\RaggedRight}p{5.6cm} >{\RaggedRight}p{5.6cm} } 
            \toprule
            \centering Traditional Care & \centering\arraybackslash Technological Care\\
            \midrule 
            Patient to keep a diary for appointments. & Automated calendar reminder to phone.\\\addlinespace
            Important items to be kept in the same place. & Alarmed receiver attached to important objects.\\\addlinespace
            Put labels on doors/cupboards. & Wearable camera to recognise and remind doors/cupboards.\\\addlinespace
            Place important numbers by the phone. & Phone with pre-stored numbers represented by familiar faces.\\\addlinespace
            Place note on back of door as reminder to take keys. & Door sensor to remind occupant to take keys when door is opened.\\\addlinespace
            Label family photographs. & Facial recognition to act as a reminder.\\\addlinespace
            Pin a weekly timetable to the wall. & Automated calendar reminder to phone/wall mounted monitor.\\\addlinespace
            Write reminders to lock door at night, turn off gas, put rubbish out etc. & Automated systems in house to turn off systems/lock doors at certain times, automated reminders.\\
            \bottomrule
        \end{tabular}
        \caption{Comparison of differing provisions of care for ADL.}
        \label{tab:activityList}
    \end{table}
\end{document}

enter image description here

1
  • 1
    That's great thanks. I had misunderstood the use of m - I was under the assumption that it was partly responsible for the horizontal centering, thanks for the improved format as well. Looks a lot more professional.
    – Colin747
    Jul 20 '15 at 10:42
0

More a comment, than a answer, but I am not allowed to comment: Couldn't you just add a blank line?

Alternatively: look here: Vertical alignment in tabular cells with variable height

0

The table spec p gives you a »paragraph column with text vertically aligned in the middle«. To vertically align at the top and centre horizontally only, the spec c is needed - which in turn will leave you with a width problem.

Two useful solutions can be found in Vertical alignment in tabular cells with variable height - basically, the idea is to give the width of the columns by using boxes and their alignment relative to their surroundings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.