Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I overflow the contents of a column into the next column using CSS?

Tags:

css

I have a table with three columns in which I'm trying to get some long paragraphs to flow dynamically from the first column into the second and then into the third. Currently, the table will continue on a next page when the first column overflows instead of moving into the second column and so I get several pages filled with only a single column's worth of data. How can I fix this?

like image 563
Thinking Avatar asked Jul 07 '10 16:07

Thinking


People also ask

How do I make my Div overflow?

Making a div vertically scrollable is easy by using CSS overflow property. There are different values in overflow property. For example: overflow:auto; and the axis hiding procedure like overflow-x:hidden; and overflow-y:auto;.

What is CSS overflow?

The CSS overflow property controls what happens to content that is too big to fit into an area. This text is really long and the height of its container is only 100 pixels. Therefore, a scrollbar is added to help the reader to scroll the content.


1 Answers

It can be done with CSS3 but most browsers does not support those properties yet. Link here: Multi-column layout

There is also a jQuery plugin for this. http://code.google.com/p/js-columns/

EDIT 2016 The column-count CSS property for multi-column layouts is supported by all major browsers (http://www.w3schools.com/css/css3_multiple_columns.asp).

Demo:

.newspaper {
    -webkit-column-count: 3; /* Chrome, Safari, Opera */
    -moz-column-count: 3; /* Firefox */
    column-count: 3;
}
<p><b>Note:</b> Internet Explorer 9, and earlier versions, does not support the column-count property.</p>

<div class="newspaper">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.
</div>
like image 171
J. K. Avatar answered Sep 20 '22 20:09

J. K.