Results 1 to 4 of 4

Math Help - Columns width under multicolumn

  1. #1
    Newbie
    Joined
    Mar 2009
    Posts
    2

    Columns width under multicolumn

    Good afternoon everybody,

    I am a begineer in Latex and I have some trouble setting column's width in a Latex document. I have double columns under which I would like the columns to be split evenly (50% of the double column each) but I juste don't understant how to get this result. Here is a sample of what I get. (hope my explanation of what I want is clear enough).

    <br />
\begin{tabular}{|c|c|c|c|c|c|c|}<br />
\hline<br />
  & \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}<br />
 & $0,\Omega$ & $1,\Omega$ & $0,\Omega$ & $1,\Omega$ & $0,\Omega$ & $1,\Omega$ \\ \hline<br />
\end{tabular}

    Thank you for your help!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Rhymes with Orange Chris L T521's Avatar
    Joined
    May 2008
    From
    Chicago, IL
    Posts
    2,844
    Thanks
    3
    Quote Originally Posted by asfd View Post
    Good afternoon everybody,

    I am a begineer in Latex and I have some trouble setting column's width in a Latex document. I have double columns under which I would like the columns to be split evenly (50% of the double column each) but I juste don't understant how to get this result. Here is a sample of what I get. (hope my explanation of what I want is clear enough).

    <br />
\begin{tabular}{|c|c|c|c|c|c|c|}<br />
\hline<br />
  & \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}<br />
 & $0,\Omega$ & $1,\Omega$ & $0,\Omega$ & $1,\Omega$ & $0,\Omega$ & $1,\Omega$ \\ \hline<br />
\end{tabular}

    Thank you for your help!
    This may be of use to you.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Opalg's Avatar
    Joined
    Aug 2007
    From
    Leeds, UK
    Posts
    4,041
    Thanks
    7
    Quote Originally Posted by asfd View Post
    Good afternoon everybody,

    I am a begineer in Latex and I have some trouble setting column's width in a Latex document. I have double columns under which I would like the columns to be split evenly (50% of the double column each) but I juste don't understant how to get this result. Here is a sample of what I get. (hope my explanation of what I want is clear enough).

    <br />
\begin{tabular}{|c|c|c|c|c|c|c|}<br />
\hline<br />
  & \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}<br />
 & $0,\Omega$ & $1,\Omega$ & $0,\Omega$ & $1,\Omega$ & $0,\Omega$ & $1,\Omega$ \\ \hline<br />
\end{tabular}

    Thank you for your help!
    The LaTeX tabular environment really isn't very helpful if you want to control widths of columns. The only way I know to get columns of equal width is to replace the "c" declaration in the table specification by something like "p{3em}". That will give a column of the specified width, but it will not be centred. However, you can then centre each individual table entry by padding it with flexible space in the form of an \hfil before and after it.
    Code:
    \begin{tabular}
      {|c|p{3em}|p{3em}|p{3em}|p{3em}|p{3em}|p{3em}|}
    \hline
    & \multicolumn{2}{c|}{Linear Elements} 
      & \multicolumn{2}{c|}{Quad Elements} 
      & \multicolumn{2}{c|}{Cubic Elements} \\
    \cline{2-7}
    &\hfil $0,\Omega$\hfil &\hfil $1,\Omega$\hfil 
      &\hfil $0,\Omega$\hfil &\hfil $1,\Omega$\hfil 
      &\hfil $0,\Omega$\hfil &\hfil $1,\Omega$\hfil \\ 
    \hline
    \end{tabular}
    That leads to
    \begin{tabular}{|c|p{3em}|p{3em}|p{3em}|p{3em}|p{3  em}|p{3em}|}<br />
\hline<br />
& \multicolumn{2}{c|}{Linear Elements} & \multicolumn{2}{c|}{Quad Elements} & \multicolumn{2}{c|}{Cubic Elements} \\ \cline{2-7}<br />
&\hfil $0,\Omega$\hfil &\hfil  $1,\Omega$\hfil &\hfil $0,\Omega$\hfil &\hfil $1,\Omega$\hfil &\hfil  $0,\Omega$\hfil &\hfil   $1,\Omega$\hfil \\ \hline<br />
\end{tabular}

    Laborious and inelegant, but it should give you the desired result.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Mar 2009
    Posts
    2
    Quote Originally Posted by Opalg View Post
    Laborious and inelegant, but it should give you the desired result.
    Thanks a lot! Your last sentence pretty much says it all.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. linear dependence of matrix columns
    Posted in the Advanced Algebra Forum
    Replies: 4
    Last Post: February 27th 2011, 09:29 AM
  2. adding rows and columns....
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: August 29th 2010, 10:47 PM
  3. Columns in a LaTeX File
    Posted in the LaTeX Help Forum
    Replies: 1
    Last Post: October 30th 2009, 10:06 PM
  4. multiplying columns and rows
    Posted in the Advanced Algebra Forum
    Replies: 2
    Last Post: September 8th 2009, 04:33 AM
  5. Students in rows and columns
    Posted in the Math Topics Forum
    Replies: 2
    Last Post: February 11th 2007, 06:16 AM

Search Tags


/mathhelpforum @mathhelpforum