table help

7 posts Page 1 of 1
Contributors
User avatar
Mark
VIP - Donator
VIP - Donator
Posts: 372
Joined: Mon Aug 17, 2009 10:35 pm

table help
Mark
Hello,

Im needing some help please i want my table to displat like this

Mark Mark Mark

but at the moment its going like this

Mark
Mark
Mark

Can anyone help me please this is the code i have for them to go like

Mark
Mark
Mark
Code: Select all
 <?php
            
               $query = mysql_query("SELECT * FROM users WHERE online='1' ORDER BY id DESC LIMIT 5"); 
               $numrows = mysql_num_rows($query); 
                if ($numrows > 0){ 
                echo '<table><tbody>';
                while($row = mysql_fetch_assoc($query)){ 
            $id = $row['id']; 
            $username = $row['username']; 
            $email = $row['email'];
             
            echo "<tr><td><div class=\"noline\"><a href='mailto:$email'>$username</a></div></td></tr>"; 
        } 
        echo '</tbody></table>';
    } 
    else 
        echo "<div class=\"noline\">No users are online!.</div>"; 
  
            
            ?> 
http://www.mbappz.com
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Re: table help
Filip
Code: Select all
 <?php
            
               $query = mysql_query("SELECT * FROM users WHERE online='1' ORDER BY id DESC LIMIT 5"); 
               $numrows = mysql_num_rows($query); 
                if ($numrows > 0){ 
                echo '<table><tbody><tr>';
                while($row = mysql_fetch_assoc($query)){ 
            $id = $row['id']; 
            $username = $row['username']; 
            $email = $row['email'];
             
            echo "<td><div class=\"noline\"><a href='mailto:$email'>$username</a></div></td>"; 
        } 
        echo '</tr></tbody></table>';
    } 
    else 
        echo "<div class=\"noline\">No users are online!.</div>"; 
  
            
            ?> 
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
Mark
VIP - Donator
VIP - Donator
Posts: 372
Joined: Mon Aug 17, 2009 10:35 pm

Re: table help
Mark
Hi that worked but is there anyways that i can put only so many per line?
http://www.mbappz.com
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Re: table help
Filip
Hi,

Alternatively you can put each element within a div within a parent and assign parent with class which would have CSS properties as follows:
Code: Select all
.classname div {
display: inline-block;
}
.classname {
white-space: nowrap;
overflow-x: scroll
}
That code would put text in boxes going one after another in one infinitive scrolling parent.

KR,
-Filip
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
Mark
VIP - Donator
VIP - Donator
Posts: 372
Joined: Mon Aug 17, 2009 10:35 pm

Re: table help
Mark
hi filip,

do you have an example?

if you look here youll see what i mean

http://yansumkune.com/members.php
http://www.mbappz.com
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Re: table help
Filip
Mark wrote:
hi filip,

do you have an example?

if you look here youll see what i mean

http://yansumkune.com/members.php
Hello,

Sorry, I'm currently on a trip and I don't have my laptop with me so I'm not able to do it on live example. I'm coming home on Saturday so I'll be able to do it..

KR,
-Filip
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: table help
CodenStuff
What do you mean by so many per line?

I can see Filips code limits to 5 results
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
7 posts Page 1 of 1
Return to “Help & Support”