/    Sign up×
Community /Pin to ProfileBookmark

Fitting dynamic tables across the page

I have a page where it prints out information of members in tables however it does it in a linear fashion. I would like it to go across the page and when it has reached the end of the page go onto the next line.

I have started to count the iterations but I’m a little stuck as what to do next , Idealy I would like to fit 3 across the page which is possible, as they fit in, but how would I do this?

[code=php]
<?php
$table=0;
while($row = mysql_fetch_array($result))
{
$table++;
?>
<table>
<tbody>
<tr>
<th>Role Name</th>
<td><?php echo $row[“role_title”]; ?></td>
</tr>
<tr>
<th>View Members</th>
<td><a href=”viewroles.php?fileId=<?php echo $row[“role_id”]; ?>”>View</a></td>
</tr>
<tr>
<th>Delete</th>
<td><a href=”delrole.php?fileId=<?php echo $row[“role_id”]; ?>”>Delete</a></td>
</tr>
<tr>
<th>Edit</th>
<td><a href=”editrole.php?fileId=<?php echo $row[“role_id”]; ?>”>Edit</a></td>
</tr>
<tr>
<th>Display Order</th>
<td><a href=”editorder.php?fileId=<?php echo $row[“role_id”]; ?>”><?php echo $row[“role_order”]; ?></td>
</tr>
</tbody>
</table>

<?php
}
?>
[/code]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @solidariti spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...