A series of blobs (divs) and I would like a space after every 4th one.

Hi all,

Hopefully someone can help me, I am stumped.

I have series of css divs (each a little blob), one after the other horizontally, This works :slight_smile:

What is missing is I want a little space after every fourth div/blob.

It is a little calendar, 4 blobs for each week, some different colours depending on what the team is doing on that week.

so visually it looks like several rows of blobs:
team 1 : blob blob blob blob redblob redblob blob blob etc
team 2 : blob redblob redblob blob blob blob etc

background :
mainfunctionA. Contains a query that takes lots of data from MYSQL, using the usual while loop.

functionB. I want a little calendar made up of little blobs, one blob for each week (so 48 blobs), these blobs are just two little divs, one no colour div = a, the other red div = b.

The functionB delivers the blobs :). I am pretty sure it is delivering them as a string, but I cant seem to split or number each div so I can take every 4th one and put a space… Ive tried the string functions array functions… maybe this is the wrong approach… the third day of playing around with it and my brain is in a gridlock… any help appreciated. :slight_smile:

I call the function in the mainfunctionA as follows:
$mindays = $row[‘min_time_days’] ;
global $mindays;
$getCalendar = calendar();

function calendar() {

global $fundays; // global variable from mainfunctionA, use 90 in this example.

$startdate = 1;

// we want a firstdate fd- which I can change through input field, for now we just say 30days
$firstdate = 30;

for ($day = 1; $day <= $firstdate / 7.5 ; $day++) {
$div = “<div id = “boxcal1” >” ; // no colour blob
echo $div ;

for ($day = 1; $day <= $fundays / 7.5 ; $day++) {
$div = “<div id = “boxcal2” >” ; // colour blob
echo $div;

$totaldays = (($firstdate + $fundays) / 7.5) ;

$totaldaysleft = ((360 / 7.5) - $totaldays) ;

$day = $totaldaysleft;

for ($day = 1 ; $day <= $totaldaysleft ; $day++) {
$div = “<div id = “boxcal1” >” ; // no colour blob
echo $div ;

Sponsor our Newsletter | Privacy Policy | Terms of Service