Texan78 Posted April 29, 2017 Share Posted April 29, 2017 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; Quote Link to comment https://forums.phpfreaks.com/topic/303829-dynamic-populating-rows/ Share on other sites More sharing options...
Solution requinix Posted April 29, 2017 Solution Share Posted April 29, 2017 You're using the part of Bootstrap's styling that sizes boxes. Don't do that. Quote Link to comment https://forums.phpfreaks.com/topic/303829-dynamic-populating-rows/#findComment-1545990 Share on other sites More sharing options...
glenelkins1984 Posted April 29, 2017 Share Posted April 29, 2017 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 Quote Link to comment https://forums.phpfreaks.com/topic/303829-dynamic-populating-rows/#findComment-1545991 Share on other sites More sharing options...
requinix Posted April 29, 2017 Share Posted April 29, 2017 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 startsThe code posted starts somewhere after it began. The page loaded, after all, so there couldn't be any syntax errors in it. Quote Link to comment https://forums.phpfreaks.com/topic/303829-dynamic-populating-rows/#findComment-1545992 Share on other sites More sharing options...
Texan78 Posted May 1, 2017 Author Share Posted May 1, 2017 You're using the part of Bootstrap's styling that sizes boxes. Don't do that. Always looking for something more significant and it was the easiest thing. -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/303829-dynamic-populating-rows/#findComment-1546028 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.