Graphics, Figures & TablesTable with 56 columns

Information and discussion about graphics, figures & tables in LaTeX documents.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Table with 56 columns

Post by gmedina »

Hi Muthu,

you can use the >{declaration} construct in the format declaration of the table. The documentation of the array package describes its use. Take a look at the following example:

Code: Select all

\documentclass{article}
\usepackage{array}
\usepackage{longtable}
\usepackage{lipsum}

\begin{document}

\begin{longtable}{>{\raggedright\arraybackslash}p{1in}>{\centering\arraybackslash}p{1in}%
  >{\raggedleft\arraybackslash}p{1in}}
  \caption{a test table}\\
  \lipsum[1] & \lipsum[1] & \lipsum[1] 
\end{longtable}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

Recommended reading 2024:

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

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

dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Re: Table with 56 columns

Post by dmuthu_cse »

Hello gmedina,

Thank you very much..

I am able to correctly get what i want with your coding..

can you help me, how if i can align the table header only in some of my tables..

Sorry.. i am putting more questions on you, coz i am a new user of latex.

I want to centeralize only the table heading(i.e. the first row of the table alone)

Please feed me your suggestions.

Regards,
Muthu. :)
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Table with 56 columns

Post by gmedina »

dmuthu_cse wrote:Hello gmedina,

Thank you very much..
Hi Muthu. You are welcome.
dmuthu_cse wrote: ...I want to centeralize only the table heading(i.e. the first row of the table alone)...
In that case, you could use the \multicolumn command, as the following example suggests:

Code: Select all

\documentclass{article}
\usepackage{array}
\usepackage{longtable}
\usepackage{lipsum}

\begin{document}

\begin{longtable}{p{2in}|>{\raggedright\arraybackslash}p{2in}}
  \caption{a table with centered headers}\\
  \multicolumn{1}{c|}{Header1} & \multicolumn{1}{c}{Header2}\\
  \lipsum[1] & \lipsum[1]
\end{longtable}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Re: Table with 56 columns

Post by dmuthu_cse »

Hello Gmedina,

Thanks again.

Regards,
Muthu
Post Reply