I want to create a golf leaderboard design similar to the one on golfchannel.com, with circles representing birdies and squares for bogeys.
https://i.sstatic.net/mDD8o.png
This project utilizes Bootstrap for styling and PHP for database management and logic.
Currently, I am working within the loop that displays the table content (mainly <td>
elements), and I have attempted the following code snippet:
switch ($tmp['holeNettPoints'][$i]) {
case 3:
$img = 'background="assets/img/oval.png"';
break;
default:
$img = "";
break;
} }
echo "<td ".$img.">".$tmp['holeNettPoints'][$i]."</td>";
However, the result is a repetition of the circular image (oval.png
) in each cell it is applied to, rather than centered singularly behind the number:
https://i.sstatic.net/dg1Wn.png
Do you think my approach is incorrect? Are there alternative methods or HTML/CSS properties that could help achieve the desired layout?