Page Layouttable problem in a 2 column layout...

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
diskhub
Posts: 11
Joined: Mon May 10, 2010 3:22 pm

table problem in a 2 column layout...

Post by diskhub »

Hi there,
i have formatted my page layout to have 2 columns.
All the text looks fine.

But when i decided to add a table (which should cover almost the whole width of the page), it turned out to be half of it as it is still stuck with the 2 column layout.

How is it possible to make it fit nicely (as shown in the figure below) without having part of the table cropped off?

Image


i could only solve the problem by putting \newpage
but there will be a big gap below the 2 columns of text, which makes the entire report look ugly.

Please guide

Recommended reading 2024:

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

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

table problem in a 2 column layout...

Post by gmedina »

Please post a minimal working example allowing us to reproduce the problem mentioned.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
diskhub
Posts: 11
Joined: Mon May 10, 2010 3:22 pm

table problem in a 2 column layout...

Post by diskhub »

gmedina wrote:Please post a minimal working example allowing us to reproduce the problem mentioned.
sample snap shot:


\documentclass[a4paper,11pt,twocolumn]{article}
\usepackage{iasted}
\usepackage{url}
\usepackage[pdftex]{graphicx}
\usepackage{graphicx}
\input epsf
\setlength{\textheight}{25.4cm}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.2cm}
\setlength{\columnsep}{0.5in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-0.33in}


\vspace{1.3cm}
\pagestyle{empty}
\title{\bf ABC Review}

\begin{abstract}
this is dummy text. this is dummy text.
this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.
\end{abstract}

\section{INTRODUCTION}
this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.this is dummy text.


Proposed Weightage for ABC / DEF
\begin{center}
\begin{tabular}{ | l | l | l | p{6cm} |}
\hline
What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
DEF & 5 & 30 & DEF are equally important as students should have much more understandng. \\ \hline
\multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on what's being taught in ABC.} \\ \hline
\end{tabular}
\end{center}


\*

\section{CONCLUSION}
his is dummy text.this is dummy textthis is dummy textthis is dummy textthis is dummy textthis is dummy textthis is dummy textthis is dummy textthis is dummy text

\end{document}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

table problem in a 2 column layout...

Post by gmedina »

Use a table* environment:

Code: Select all

\documentclass[a4paper,11pt,twocolumn]{article}

\begin{document}

\begin{table*}
  \centering
  \caption{Proposed Weightage for ABC / DEF}
  \begin{tabular}{ | l | l | l | p{6cm} |}
  \hline
  What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
  ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
  DEF & 5 & 30 & DEF are equally important as students should have much more understandng. 
    \\ \hline
  \multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on 
    what's being taught in ABC.} \\ \hline
  \end{tabular}
\end{table*}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
diskhub
Posts: 11
Joined: Mon May 10, 2010 3:22 pm

table problem in a 2 column layout...

Post by diskhub »

gmedina wrote:Use a table* environment:

Code: Select all

\documentclass[a4paper,11pt,twocolumn]{article}

\begin{document}

\begin{table*}
  \centering
  \caption{Proposed Weightage for ABC / DEF}
  \begin{tabular}{ | l | l | l | p{6cm} |}
  \hline
  What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
  ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
  DEF & 5 & 30 & DEF are equally important as students should have much more understandng. 
    \\ \hline
  \multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on 
    what's being taught in ABC.} \\ \hline
  \end{tabular}
\end{table*}

\end{document}

By doing the above,
the paragraph below the table went up and join the paragraph above the table.
And the table was created in a new page.

This is not what i prefer...
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

table problem in a 2 column layout...

Post by gmedina »

In this case I would suggest you to drop the twocolumn class option and to use the multicol package instead; you can also drop the table* environment so now the table won't float and will appear where you declare it in the .tex file; the \captionof command provided by the caption package lets you obtain a caption for the table:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{multicol}
\usepackage{caption}
\usepackage{lipsum} % just to generate filler text for the example
\begin{document}

\begin{multicols}{2}
this is some text before the table \lipsum[1-2]
\end{multicols}

{
\noindent\centering
\captionof{table}{Proposed Weightage for ABC / DEF}
\begin{tabular}{ | l | l | l | p{6cm} |}
  \hline
  What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
  ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
  DEF & 5 & 30 & DEF are equally important as students should have much more 
    understandng.\\ \hline
  \multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on 
    what's being taught in ABC.} \\ \hline
\end{tabular}
}

\begin{multicols}{2}
this is some text after the table \lipsum[1-20]
\end{multicols}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
diskhub
Posts: 11
Joined: Mon May 10, 2010 3:22 pm

table problem in a 2 column layout...

Post by diskhub »

gmedina wrote:In this case I would suggest you to drop the twocolumn class option and to use the multicol package instead; you can also drop the table* environment so now the table won't float and will appear where you declare it in the .tex file; the \captionof command provided by the caption package lets you obtain a caption for the table:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{multicol}
\usepackage{caption}
\usepackage{lipsum} % just to generate filler text for the example
\begin{document}

\begin{multicols}{2}
this is some text before the table \lipsum[1-2]
\end{multicols}

{
\noindent\centering
\captionof{table}{Proposed Weightage for ABC / DEF}
\begin{tabular}{ | l | l | l | p{6cm} |}
  \hline
  What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
  ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
  DEF & 5 & 30 & DEF are equally important as students should have much more 
    understandng.\\ \hline
  \multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on 
    what's being taught in ABC.} \\ \hline
\end{tabular}
}

\begin{multicols}{2}
this is some text after the table \lipsum[1-20]
\end{multicols}

\end{document}

thanks it works fine.
but a small problem.

before my \begin{document}
i have the following code
\title{\bf ABC Review}
\author
{
CHRIS CHIA\\
this is a test\\
}

and now it has become on the left of the 2 columns.
How can i display it to occupy the entire page (both column length) just like the table? if so, can show me a snapshot of the code?
thanks so much for ur help
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

table problem in a 2 column layout...

Post by gmedina »

I assume the you are using \maketitle; if this is so, then simply use that command outside the multicols environment:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{multicol}
\usepackage{caption}
\usepackage{lipsum} % just to generate filler text for the example

\title{\bfseries The Title}
\author{The Author}

\begin{document}
\maketitle

\begin{multicols}{2}
this is some text before the table \lipsum[1-2]
\end{multicols}

{
\noindent\centering
\captionof{table}{Proposed Weightage for ABC / DEF}
\begin{tabular}{ | l | l | l | p{6cm} |}
  \hline
  What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
  ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
  DEF & 5 & 30 & DEF are equally important as students should have much more 
    understandng.\\ \hline
  \multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on 
    what's being taught in ABC.} \\ \hline
\end{tabular}
}

\begin{multicols}{2}
this is some text after the table \lipsum[1-20]
\end{multicols}

\end{document}
If you're problem persists, please post the relevant part of the actual code that you are using and that allows us to reproduce the undesired behaviour.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
diskhub
Posts: 11
Joined: Mon May 10, 2010 3:22 pm

table problem in a 2 column layout...

Post by diskhub »

gmedina wrote:I assume the you are using \maketitle; if this is so, then simply use that command outside the multicols environment:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{multicol}
\usepackage{caption}
\usepackage{lipsum} % just to generate filler text for the example

\title{\bfseries The Title}
\author{The Author}

\begin{document}
\maketitle

\begin{multicols}{2}
this is some text before the table \lipsum[1-2]
\end{multicols}

{
\noindent\centering
\captionof{table}{Proposed Weightage for ABC / DEF}
\begin{tabular}{ | l | l | l | p{6cm} |}
  \hline
  What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
  ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
  DEF & 5 & 30 & DEF are equally important as students should have much more 
    understandng.\\ \hline
  \multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on 
    what's being taught in ABC.} \\ \hline
\end{tabular}
}

\begin{multicols}{2}
this is some text after the table \lipsum[1-20]
\end{multicols}

\end{document}
If you're problem persists, please post the relevant part of the actual code that you are using and that allows us to reproduce the undesired behaviour.


i have to say u r FAST n the BEST!!!
thanks for all the help.

it works PERFECTLY
diskhub
Posts: 11
Joined: Mon May 10, 2010 3:22 pm

table problem in a 2 column layout...

Post by diskhub »

gmedina wrote:I assume the you are using \maketitle; if this is so, then simply use that command outside the multicols environment:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{multicol}
\usepackage{caption}
\usepackage{lipsum} % just to generate filler text for the example

\title{\bfseries The Title}
\author{The Author}

\begin{document}
\maketitle

\begin{multicols}{2}
this is some text before the table \lipsum[1-2]
\end{multicols}

{
\noindent\centering
\captionof{table}{Proposed Weightage for ABC / DEF}
\begin{tabular}{ | l | l | l | p{6cm} |}
  \hline
  What's being taught & Current Weightage & Suggested Weightage & Summary \\ \hline
  ABC & 95 & 70 & I think some of the Practical time used on ABC should be allocated. \\ \hline
  DEF & 5 & 30 & DEF are equally important as students should have much more 
    understandng.\\ \hline
  \multicolumn{4}{|c|}{\em The current weightage is rated based on how a student feels on 
    what's being taught in ABC.} \\ \hline
\end{tabular}
}

\begin{multicols}{2}
this is some text after the table \lipsum[1-20]
\end{multicols}

\end{document}
If you're problem persists, please post the relevant part of the actual code that you are using and that allows us to reproduce the undesired behaviour.

hi, i seem to have a problem with my page no after using the method.
Page no only appears for page 1.
the rest of the page doesn't show any number.

Some advise?
Post Reply