0

Thanks for previous helps. Am here with another one.

Ok, so i am retrieving data from database.. its working fine, but where i have issues is that after the data spans the first row it doesn't start from the first column of the next row.. I don't know how to explain this better ... but I'I'll add the code and image here....

<div class="row">
                     <?php

                                        $selectCat = "SELECT * FROM categories ORDER BY cat_id DESC";
                                        $selectCatKwary = mysqli_query($link, $selectCat);
                                        $catCount = mysqli_num_rows($selectCatKwary);
                                        if ($catCount > 0) {

                                        ?>

                                        <?php
                                        while ( $catRow = mysqli_fetch_array($selectCatKwary)) { ?>

                    <a href="">
                        <div class="col-lg-3 col-sm-6">
                            <div class="card">
                                <div class="content">
                                    <div class="row">


                                        <div class="col-xs-5">
                                            <div class="icon-big icon-warning text-center">
                                                <i class="ti-user"></i>
                                            </div>
                                        </div>
                                        <div class="col-xs-7">
                                            <div class="numbers">
                                                <p class="text-uppercase text-bold"><?php echo $catRow['catTitle']; ?></p>
                                                105GB
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </a>
                    <?php  } } ?>
                </div>

and here is the image

image of how it shows

The first four data resolved well... the next one which MOBILE CARS did not start from the beginning column, and also affected others

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
  • 1
    this is neither a php nor a mysqli question. – YvesLeBorg Sep 10 '18 at 15:56
  • Hmm..... It is.... Cuz wen I try to start my WHILE LOOP before the
    .... It displays them as list.... I did like to display them in grid
    – user3449184 Sep 10 '18 at 15:59
  • 1
    I'm assuming it is because your columns aren't the same height, e.g. "COMPUTER GAMES" moving onto the next line. Checkout this answer here: https://stackoverflow.com/questions/37460834/how-to-prevent-bootstrap-columns-jump-from-one-part-to-the-other-or-under-each-o – Gary Thomas Sep 10 '18 at 16:05
  • @YvesLeBorg is correct, this is CSS issue and not understanding how floats work. _Mobile Cars_ is _"snagging"_ on _Computer Games. Though I would try to not use the solution in the link above, it uses fixed heights. If you were using Bootstrap 4, your columns would be equal height by default. – hungerstar Sep 10 '18 at 16:13
  • @hungerstar.. so do you suggest I just change from bootstrap 3 to 4 – user3449184 Sep 10 '18 at 18:34
  • Possibly. If you are just starting your project and do not have too much time invested, then switching might be worthwhile. Otherwise, you might want to look at a solution like this: https://stackoverflow.com/questions/19695784/how-can-i-make-bootstrap-columns-all-the-same-height#answer-22892773 – hungerstar Sep 10 '18 at 18:43

0 Answers0