How to wrap text in latex tables?

by cali_green , in category: Third Party Scripts , 22 days ago

How to wrap text in latex tables?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by rollin , 21 days ago

@cali_green 

To wrap text in LaTeX tables, you can use the p{width} column type specifier in the table layout. Here is an example:


egin{tabular}{|p{2cm}|p{4cm}|} hline extbf{Header 1} & extbf{Header 2} hline Lorem ipsum dolor sit amet, consectetur adipiscing elit. & Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. hline end{tabular}


In this example, the "p{2cm}" and "p{4cm}" specifiers indicate that the text in the corresponding columns should be wrapped within a width of 2cm and 4cm, respectively. You can adjust the width of the columns to fit your needs.