Jump to content

Problem with "break-before: column"


phdphd

Recommended Posts

Hi All,

 

In one of the pages of my site, I extract a series of terms, classified by categories, from a database. Initially, all info was listed in a single column (category name, term list, other category name, other terms list), which left much unused room on the center & right sections of the page.

 

From a CSS code available at http://www.inserthtml.com/2012/01/css3-multi-column-layout-implementation-change-website-design/, I successfully applied a formatting in order to use the whole width of the page.

 

Now the problem is that one category of terms can start at the end of a column and continue at the top of the next one. To force a column break before each category, I associated a <span class="breakhere">category_name</span> tag to the categories and added

 

.breakhere {

color: blue;

break-before: column;

-webkit-column-break-before: column;

-moz-column-break-before: column;

-ms-column-break-before: column;

-o-column-break-before: column;

}

 

 

to the CSS code. This tag is functional since the text does display in blue. However, no column break is applied before the category names.

 

Any idea of what is going wrong ?

 

Thanks !

 

Link to comment
Share on other sites

  • 1 month later...

Hi

 

im not sure what do you mean by column break , but maybee this  will help :

1)if you will use while loop you can handle it easy .

while (condition ){

/* fetch the data you need (categories)*/

if /*number of cateogries*/  $category_count%x(its the number of the wanted catogries in a row )=0

echo '<br>';

 

so im using here modulo which is doing line break everytime there is the wanted number of categories .

 

and if your using table with td and tr you can define the pairing td (2,4,6,8,10..) for example with id=pair and the other td (1,,3,5,7,9....) id=unpair and do like that :

and use just one of them for the cateogries and the other will be the column space ,example  you want the td id=unpair so

you can use same modulo like above and fetch the data just when the td is 1,3,5,7,9 or on 2,4,6,8,10.

its 2 ideas maybee it will help .

Avi

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.