Jump to content

Making tables in php


supermerc

Recommended Posts

Hey, in my page to view users profile I want to insert tables to organize the stuff a little.

I want it to look like this

Username

Profile Picture    Name
                      Email
                      More stuff
                      morestuff
Description      More stuff

I only have a couple of them in my view profile page but id like to know how to make it in a table looking like that.

This is the code of where i got my things.

[code]$profile_info = mysql_fetch_assoc($member_info);
      echo "
      <h1>$profile_info[username]</h1>
      <br />
  <b>$drawavatar($r[author]);
  <br/>
  <b>Name: $profile_info[name]
  <br />
  <b>Descriptions: $profile_info[description]
      <br />
      <b>Email:</b> <a href='mailto:$profile_info[email]'>$profile_info[email]</a>
      <br />
      <br />
      ";[/code]
Link to comment
https://forums.phpfreaks.com/topic/31532-making-tables-in-php/
Share on other sites

you will want to use a while string to list all the users you have.. heres an example..

[code]<?php
while($row = mysql_fetch_assoc($member_info)) {
extract($row);
?>
  <tr>
  <td><?php echo $user_name; ?></td>
  <td width="120" align="center"><?php echo $picture; ?></td>
  <td width="120" align="center"><a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a></td>
  </tr>
<?php
} // end while

?>[/code]

and you can just add in a couple more rows for the other pieces you want.. how that helps
Link to comment
https://forums.phpfreaks.com/topic/31532-making-tables-in-php/#findComment-146096
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.