Graphics, Figures & TablesMulti-Column Float Tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
insipidtoast
Posts: 128
Joined: Wed Jul 04, 2012 5:34 pm

Multi-Column Float Tables

Post by insipidtoast »

Is it possible to have multi-columns in a float table(s)? If so, how?

As I understand, the float table can be placed automatically by Latex to find the best possible position within a "Section" based on its algorithm. That way you don't have to worry about latex making a big gap at the bottom of one page, so it can fit the tables on the next page.

Why won't Latex do like Microsoft word does, and just put a few lines of a table on one page, and then finish up the rest of the table on the next page?
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class

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: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Multi-Column Float Tables

Post by Stefan Kottwitz »

insipidtoast wrote:Why won't Latex do like Microsoft word does, and just put a few lines of a table on one page, and then finish up the rest of the table on the next page?
Word is, as a commercial product, focused on being easily used by everybody, even without good computer skills, to sell much. So it just breaks a table.

LaTeX is focused at best output quality, layout design and text structure, even if it requires some learning to use it. Of course it provides ways for page breaks in tables, with Continued captions and more features. For example, there's the longtable package. But different topics should be discussed in different threads. So if you have follow-up questions regarding multi-page tables, better not continue in this topic about multi-column floats, but create another thread.

Stefan
LaTeX.org admin
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Multi-Column Float Tables

Post by cgnieder »

insipidtoast wrote:Is it possible to have multi-columns in a float table(s)? If so, how?
Do you mean something like this?

Code: Select all

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}% for dummy text

\begin{document}

\lipsum[1]

\begin{table}[ht]
 \caption{A twocolumned ``table''.}
 \centering
 \begin{minipage}{.8\linewidth}
 \begin{multicols}{2}
  \lipsum[2]
 \end{multicols}
 \end{minipage}
\end{table}

\lipsum[3]
\end{document}
Regards
site moderator & package author
insipidtoast
Posts: 128
Joined: Wed Jul 04, 2012 5:34 pm

Multi-Column Float Tables

Post by insipidtoast »

cgnieder wrote:
insipidtoast wrote:Is it possible to have multi-columns in a float table(s)? If so, how?
Do you mean something like this?

Code: Select all

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}% for dummy text

\begin{document}

\lipsum[1]

\begin{table}[ht]
 \caption{A twocolumned ``table''.}
 \centering
 \begin{minipage}{.8\linewidth}
 \begin{multicols}{2}
  \lipsum[2]
 \end{multicols}
 \end{minipage}
\end{table}

\lipsum[3]
\end{document}
Regards
I can't say, because I haven't figured out how to enter this into a lyx document so that I can actually see what it represents.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Multi-Column Float Tables

Post by cgnieder »

Here is how my code from above looks:
twocoltbl.png
twocoltbl.png (85.61 KiB) Viewed 4705 times
site moderator & package author
insipidtoast
Posts: 128
Joined: Wed Jul 04, 2012 5:34 pm

Re: Multi-Column Float Tables

Post by insipidtoast »

Yes, I'm basically asking if you can have that multicolumn part as a float? Obviously mine would be tables.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: Multi-Column Float Tables

Post by cgnieder »

The table environment is a float. As you can see you can basically place everything in there.

Regards
site moderator & package author
Post Reply