Put space every 200px

2

I want to make a div that inside has several ul and li that is automatically filled with mysql and php with a foreach. The div is infinite and I want every 200px to put a 50px separator automatically.

Can this be done?

The size of the content is not always the same, sometimes it will occupy 200 lines and another 2.

I would really like to do it with a table or another way, the only thing I can not do is remove it from the container div.

I'm a little desperate with this topic :( I've been 3 months and there's no way.

A thousand thanks for your help.

    
asked by Killpe 08.02.2017 в 22:44
source

1 answer

0

what I would do is put a variable and a counter to know every one that is needed but if you use mysql an example I know this to be able to leave a message of an image and thus enter a data well for the user sees it what you have to do is a counter that every 199 puts a variable 0 or 1 if you do not know how to code

// // // // // // // // // Here is to see the chat data----------------->
function cargar_datos(){
        require ("languages/es.php");


$id= $_GET['v']; 

        $data_chat = mysql_query("SELECT * from chat WHERE post=$id ");
    if (mysql_num_rows($data_chat) == 0)
    {
                echo '<br><br><br><center><img src="img/no_messages.png"></img><br>
                '.$Languages_12.'</center>';

    }else{  

    while($res=mysql_fetch_array($data_chat)){
        $user=$res["nombre"];
        $ads=$res["ads"];
        $pads=$res["pads"];
        $men=$res["mensaje"];
        $images=$res["images"];
        $audio=$res["audio"];
        $link=$res["link"];
        $tipo=$res["tipo"];
        $post=$res["post"];
        $time=$res["time"];
        $addressID=$res["id"];
        $timeMessage = time_elapsed($time);



            /////Mensaje
                    $come[0]='';
                    $come[1]="<img src='img/publi2.png' alt=''>";
// // // // // // // // // // // // // // Content type------------------------->
// // // // // // chat
                     $type[0]="<div id='chat' class='message__chat'>
                                        <img class='resize--img' src='img/avatar_default.png' alt=''>               
                                        <p class='message__text'><spam class='message__username'>".$user."</spam>
                                        <spam class='message__username_time'>".$timeMessage."</spam>
                                        <br>".nl2br(bb_parse($res["mensaje"]))."</p>
                               </div>".$come[$ads]."";
// // // // // // imagen        
                    $type[1]="<div id='chat' class='message__img'>
                                    <img class='resize--img' src='img/avatar_default.png' alt=''>               
                                    <p class='message__text'><spam class='message__username'>".$user."</spam>
                                    <spam class='icons_img'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</spam>
                                    <spam class='message__username_time'>".$timeMessage."</spam></p>
                               </div>
                    <div class='message__chat m--user'>
                        <p class='message__text t--user'><img src='uploads/".$post."/".$images."' alt='' width='100%' height='100%'></p>
                    </div>
                        <div class='line'></div>";
// // // // // // audio
                     $type[2]="<div id='chat' class='message__chat'>
                                        <img class='resize--img' src='img/avatar_default.png' alt=''>               
                                        <p class='message__text'><spam class='message__username'>".$user."</spam>
                                        <spam class='message__username_time'>".$timeMessage."</spam><br></p>
                                    <audio controls>
                                      <source src='uploads/".$post."/".$audio."' type='audio/mpeg'>
                                    </audio>
                              </div>";                      
// // // // // // Here are the chat messages    
            echo Hashtag("".$type[$tipo].""); youtube($link); 


        }
    }

}
    
answered by 09.02.2017 в 01:19