SwiftGameR Posted February 28, 2020 Share Posted February 28, 2020 I have only just started coding for gl engine and its still quite new to me I have been building a paid module (Boss Fights) i have all the code set up and attack functions are working properly there is a slight issue when im trying to display the last 10 hits in mccodes would be easy buy this i dont fully understand yet So basiclly i want it to display something like this <th>User</th> <th>Damage done</th> Then under the user the users name and under damage done i want it to say there damage but now i get it like this 1 Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted February 28, 2020 Share Posted February 28, 2020 Without seeing what you are actually doing, it looks like you are including the table header(s) in your loop where as you really only want to include the table cells in your loop Quote Link to comment Share on other sites More sharing options...
TonyCisseroni Posted February 28, 2020 Share Posted February 28, 2020 (edited) You want something like this... <table> <tr> <th>User</th> <th>Damage Done</th> </tr> <?php // code to loop rows $hits = count($action); while($x <= $hits) { echo "<tr>"; echo "<td>$action['user']</td>"; echo "<td>$action['damage']</td>"; echo "</tr>"; $x++; } ?> </table> Edited February 28, 2020 by TonyCisseroni 1 Quote Link to comment Share on other sites More sharing options...
Dayo Posted February 28, 2020 Share Posted February 28, 2020 (edited) <table> <thead> <tr> <th>User</th> <th>Damage</th> </tr> </thead> <tbody> {#each hits} <tr> <td>{>userName}</td> <td>{damage} Damage</td> </tr> {/each} </tbody> </table> You could do somrthing like this in the tpl.php file Edited February 28, 2020 by Dayo 3 Quote Link to comment Share on other sites More sharing options...
SwiftGameR Posted February 28, 2020 Author Share Posted February 28, 2020 (edited) 14 hours ago, Dayo said: <table> <thead> <tr> <th>User</th> <th>Damage</th> </tr> </thead> <tbody> {#each hits} <tr> <td>{>userName}</td> <td>{damage} Damage</td> </tr> {/each} </tbody> </table> <table> <thead> <tr> <th>User</th> <th>Damage</th> </tr> </thead> <tbody> {#each hits} <tr> <td>{>userName}</td> <td>{damage} Damage</td> </tr> {/each} </tbody> </table> You could do somrthing like this in the tpl.php file Thanks Dayo this is what i need exactly Thank you to everyone for your answers but gangsters legends styling is a little different which im still getting used to Edited February 28, 2020 by SwiftGameR Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.