2

I have a problem with this table. I want to set the right column (whose is set by p{9cm}) to be left align, but if I replace it with l{9cm}, it will be error. How to solve it? Here is my code:

\documentclass[a4paper,oneside,11pt]{book}
\usepackage[hmargin={4cm,3cm},vmargin={4cm,3cm}]{geometry}
\usepackage{tabularx}
\usepackage{lipsum}
\begin{document}
    \chapter{Chapter's Name}
    \begingroup
    \setlength\extrarowheight{13pt}
    \noindent\begin{tabular}{@{}lcp{9cm}}
        Random Text&:&\uppercase{random text here. mmmmmmmmm nnnnnnnnnn bbbbbbbbb. vvvvvvvvvv ccccccccccccccccccccccc xx zzzzzzzzzzzzzzzzzzzzzzzzzzzz}\\
        Random Text 2&:&\uppercase{random text here. mmmmmmmmm nnnnnnnnnn bbbbbbbbb. vvvvvvvvvv ccccccccccccccccccccccc xx zzzzzzzzzzzzzzzzzzzzzzzzzzzz}
    \end{tabular}
    \endgroup
\end{document}

The output is:

enter image description here

I want to change the setting of the right column from p{9cm} to l{9cm} (left align), but if I do it, it will be error. What should I do to handle the long space between word (red line)?

Wind
  • 389
  • I want to change the setting of right column from p{9cm) to left align but if I replace p{9cm} with l, the long text (I use \lipsum to represent it here} will out of margin. – Wind Mar 25 '21 at 13:52
  • Sorry if you're confused. I have edited my question, maybe it will make my question clearer. – Wind Mar 25 '21 at 14:08
  • Unfortunately, it doesn't. If I follow it, my first column will be vertically centered. – Wind Mar 25 '21 at 14:35
  • 2
    Well, of course you shouldn't use an m column. \begin{tabular}{@{}lc>{\raggedright\arraybackslash}p{9cm}}. – campa Mar 25 '21 at 14:36
  • oh, it works. thank you so much for solving my problem. – Wind Mar 25 '21 at 14:49

0 Answers0