Graphics, Figures & TablesTabular: Centering text in one row & better text alignment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
davidfall
Posts: 14
Joined: Thu Aug 11, 2011 4:11 pm

Tabular: Centering text in one row & better text alignment

Post by davidfall »

Hi,

I have to issues creating a table using the tabular environment. I'm quite new to latex, so the solutions might be quite easy...

1: I would like to center the text in the first row. Is it possible?

2: I have a lot of text in some cells and it looks awful as it spreads out all over the cell width. Can i get "normal" alignment somehow?

Many thanks in advance!
Last edited by davidfall on Wed Aug 24, 2011 9:53 am, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Tabular: Centering text in one row & better text alignment

Post by Stefan Kottwitz »

Hi David,
  1. yes, using \centering or \multicolumn, for example

    Code: Select all

    \multicolumn{3}{c}{Text}
  2. you could use \raggedright in the column definition or within the cell.
If it's too theoretical, you could show us your example table and we can tell you how you can apply a solution.

Stefan
LaTeX.org admin
davidfall
Posts: 14
Joined: Thu Aug 11, 2011 4:11 pm

Re: Tabular: Centering text in one row & better text alignme

Post by davidfall »

Thanks!

For the record I solved 1 by using \centering and 2 by using \raggedright in a tabularx-environment (as it fitted my purpose better).

Again, thanks alot.
Post Reply