I have a PHP function looping through database rows and fetching the results in a 3 column grid that is intended to auto populate the fetched results column by column. Essentially I am facing 2 issues on this:
The resulting tables items (fields) are being broken in Chrome while being generally auto-filling the columns as intended. I would like the column break only after any complete table fetched into the previous column.
- For Firefox the moz-column-fill attribute does not seem to exist and so results are always only displayed in one column. Even in the CSS file it is visible that this moz-column-fill attribute does not seem to be valid which apparently is an ongoing issue for a long time. I would appreciate any suggestion to realize the intended column behaviour in the given scenario.
PHP/HTML code on page (working as intended):
<div name="eventsframe" class="eventstable">
<table id="events" class="table">
<?php
while($row=$stmt->fetch()) {
echo "<tr><td bgcolor='#FFA500'>" .$row["event_name"]."</td></tr>";
echo "<tr><td>" .$row["event_description"]."</td></tr>";
echo "<tr><td>" .$row["event_category"]."</td></tr>";
echo "<tr><td>" .$row["event_venue"]."</td></tr>";
echo "<tr><td>" .$row["event_location"]."</td></tr>";
}
} else {
echo "There are no events listed for the date selected.";
}
?>
</table>
</div>
The current CSS code:
.eventstable {
overflow: auto;
column-count: 3;
column-gap: 10px;
column-fill: auto;
-webkit-column-count: 3;
-webkit-column-gap: 10px;
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid-column;
-moz-column-count: 3;
-moz-column-gap: 10px;
-moz-column-fill: auto;
}
I have tried a lot of edits on the based on suggestions I found on similar problems on the second point but none of them resulted in the desired behaviour.
Thanks for any suggestions
EDIT
The expected result would be that column breaks only occur after a complete element and before the next one (headline of the events are marked in orange).
Example output (FF):
<div id="datepicker">
<form action="index4.php" method="POST">
<label>Event date: </label>
<input type="date" name="selecteddate" value="2018-04-08"/><br /><br />
<input type="submit" class="button" name="submit" value="Show events"/>
</form>
</div>
<br>
<div name="eventsframe" class="eventstable">
<table id="eventsframe" class="table">
<tr><td bgcolor='#FFA500'>1111111111</td></tr><tr><td>sasss</td></tr><tr><td>Music</td></tr><tr><td>2233</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>111</td></tr><tr><td>111</td></tr><tr><td>Music</td></tr><tr><td>111</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>222</td></tr><tr><td>222</td></tr><tr><td>Music</td></tr><tr><td>222</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>333</td></tr><tr><td>333</td></tr><tr><td>Music</td></tr><tr><td>333</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>333</td></tr><tr><td>33</td></tr><tr><td>Music</td></tr><tr><td>333</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>444</td></tr><tr><td>444</td></tr><tr><td>Music</td></tr><tr><td>444</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>555</td></tr><tr><td>555</td></tr><tr><td>Music</td></tr><tr><td>555</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>666</td></tr><tr><td>666</td></tr><tr><td>Music</td></tr><tr><td>666</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>777</td></tr><tr><td>777</td></tr><tr><td>Music</td></tr><tr><td>777</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>888</td></tr><tr><td>888</td></tr><tr><td>Music</td></tr><tr><td>888</td></tr><tr><td>Dublin 1</td></tr><tr><td bgcolor='#FFA500'>gfgvbfc</td></tr><tr><td>vgvv</td></tr><tr><td>Music</td></tr><tr><td>ugnh</td></tr><tr><td>Dublin 1</td></tr> </table>
</div>
<br>
<hr />
<a href="about4.php">About</a>
<br />
© JB 2018
</body>
</html>