Jump to content


Photo

Dynamic populating rows


Best Answer requinix, 29 April 2017 - 08:56 AM

You're using the part of Bootstrap's styling that sizes boxes. Don't do that. Go to the full post


  • Please log in to reply
4 replies to this topic

#1 Texan78

Texan78
  • Members
  • PipPipPip
  • Advanced Member
  • 272 posts

Posted 29 April 2017 - 08:38 AM

Hello, 

 

I am looking for some assistance with something I done before but forgot and I can't find my code snippets from when I used this method in the past. If you reference the screenshot below you will see boxes going across. What I am trying to do is put each one on its own row but can't remember how it is done. I have tried putting a <tr> in the loop but that doesn't work which I have commented out below where I had it for example purposes. Could anyone offer some help with this? BTW I am using this with bootstrap and calling it into the HTML template with jQuery so it refreshes on its own with updated information.

 

-Thanks 

// If no storms were in the source, set no storm message
if($error) {
     $AlertData .= "<div style='{$divNoStorms}' class='alert alert-info' role='alert' data-toggle='tooltip' data-placement='top' title='There are currently no active severe weather alerts.'>\n";
     $AlertData .= "{$noStormMessage}\n";
     $AlertData .= "</div>\n";                                                                                
} elseif ($event == 'Tornado Warning' || $event == 'Severe Thunderstorm Warning' || $event == 'Flash Flood Warning') {
    //$AlertData .= "<tr>\n";
    $AlertData .= "<div class='col-md-3'>\n";
    $AlertData .= "<div id='{$alertID}' class='individualAlert'>\n";
    $AlertData .= "<div class='text_alert'>\n";
    $AlertData .= "<span class='title {$alertClass}'><i class='fa fa-exclamation-triangle severe-icon__tornado'></i>{$event}</span>\n";
    $AlertData .= "<span class='state'>{$stateShort}</span>\n";
    $AlertData .= "<span class='counties'>{$area}</span>\n";
    $AlertData .= "<span class='expires'>Expires: {$expiresDate}</span>\n";
    $AlertData .= "</div>\n";
    $AlertData .= "<div class='alert__view'>\n";
    $AlertData .= "<span class='fa fa-eye'></span>\n";
    $AlertData .= "</div>\n";
    $AlertData .= "</div>\n";
}
    $AlertData .= "</div>\n";
    //$AlertData .= "</tr>\n";

       endforeach;
endif;

echo $AlertData;

severe_example.png



#2 requinix

requinix
  • Administrators
  • Lazy Administrator
  • 9,135 posts
  • LocationWA

Posted 29 April 2017 - 08:56 AM   Best Answer

You're using the part of Bootstrap's styling that sizes boxes. Don't do that.
The Reimann Zeta Function Trolley Problem | "Stop! You're spoiling my unjustified indignation!"

#3 glenelkins1984

glenelkins1984
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 29 April 2017 - 09:43 AM

I don't know if I'm being blind here but where is the start of the for each loop? You have endforeach but I can't see where the loop starts

#4 requinix

requinix
  • Administrators
  • Lazy Administrator
  • 9,135 posts
  • LocationWA

Posted 29 April 2017 - 09:47 AM

I don't know if I'm being blind here but where is the start of the for each loop? You have endforeach but I can't see where the loop starts

The code posted starts somewhere after it began. The page loaded, after all, so there couldn't be any syntax errors in it.
The Reimann Zeta Function Trolley Problem | "Stop! You're spoiling my unjustified indignation!"

#5 Texan78

Texan78
  • Members
  • PipPipPip
  • Advanced Member
  • 272 posts

Posted 01 May 2017 - 02:26 AM

You're using the part of Bootstrap's styling that sizes boxes. Don't do that.

 

 

:facewall:

 

Always looking for something more significant and it was the easiest thing. 

 

-Thanks






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users