I’m basically trying to center 3 images in-between the top of 4
and I need the top 3 images to center on above the bottom 4
<div class="supercenter center" id="menuButtons" style="bottom: -15%;">
<table>
<tr class="menuButtonList">
<td id="menu_create"><a tabindex="1" href=""><img class="menubutton menu-create" src="../assets/category-create.png" title="Create"></a></td>
<td><a tabindex="1" href="./leaderboard"><img class="menubutton menu-leaderboard" src="../assets/category-scores.png" title="Scores"></a></td>
<td><a tabindex="1" href="./search/*?type=saved"><img class="menubutton menu-saved" src="../assets/category-saved.png" title="Saved Levels"></a></td>
</tr>
<tr class="menuButtonList">
<td id="menu_quests"><a tabindex="1" href=""><img class="menubutton menu-quests" src="../assets/category-quests.png" title="Quests"></a></td>
<td id="menu_daily"><a tabindex="1" href="./daily"><img class="menubutton menu-daily" src="../assets/category-daily.png" title="Daily Level"></a></td>
<td id="menu_weekly"><a tabindex="1" href="./weekly"><img class="menubutton menu-weekly" src="../assets/category-weekly.png" title="Weekly Demon"></a></td>
<td><a tabindex="1" href="./gauntlets"><img class="menubutton menu-gauntlets" src="../assets/category-gauntlets.png" title="Gauntlets"></a></td>
</tr>
<tr class="menuButtonList">
<td id="menu_featured"><a tabindex="1" href="./search/*?type=featured"><img class="menubutton menu-featured" src="../assets/category-featured.png" title="Featured"></a></td>
<td><a tabindex="1" href="./search/*?type=hof"><img class="menubutton menu-hof" src="../assets/category-hof.png" title="Hall Of Fame"></a></td>
<td><a tabindex="1" href="./mappacks"><img class="menubutton menu-mappacks" src="../assets/category-packs.png" title="Map Packs"></a></td>
<td><a tabindex="1" href="./search"><img class="menubutton menu-search" src="../assets/category-search.png" title="Search"></a></td>
</tr>
</table>
</div>
The css class aren’t really touched so don’t worry about that.
I tried using a couple AI stuff like copilot or chatgpt which are too stupid and I tried asking people but didn’t get a response.
2
Answers
Option One. Add colspans to your existing table:
Your data isn’t really appropriate for table layout but to achieve what you want you will have to modify your table rows to have 12 columns (the lowest common multiple of 3 and 4) and set your cells to span multiple columns. Like so:
Option 2. Use Grid or Flexbox instead:
Both CSS Grid and CSS Flexbox can achieve this sort of layout. Here’s an example of one way to achieve it using CSS Grid:
Resources:
The best solution would be to use html FLEX but for table you have two ugly solutions:
1- Nested tables:
2- A table with 12 cells (3 and 4 LCM) and use colspan: