I am currenlty making a table which compares the differences between clutch designs for vehicles. The table looks like this:
#clutch-types td {
border: 1px solid #ddd;
}
#clutch-types {
width: 100%;
border-collapse: collapse;
}
#clutch-types td img {
display: block;
margin-left: auto;
margin-right: auto;
}
#clutch-types td {
text-align: center;
padding: 8px;
}
.clutch-attribute {
font-weight: bolder;
}
.clutch-info {
border: 0 !important;
background: #FFF;
}
#which-clutch-design {
word-spacing: 9999999px;
font-size: 30px;
color: black;
text-align: center;
padding: 10px;
}
.clutch-design {
padding: 10px
}
#clutch-types tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
<table class="clutch-types-desktop" id="clutch-types">
<colgroup>
<col span="4" style="width: 25%">
</colgroup>
<tr>
<th rowspan="3" class="clutch-design">Which Clutch Design?</th>
<th>HD (Organic)</th>
<th>Twin Friction</th>
<th>Paddle</th>
</tr>
<tr>
<td class="clutch-info">Reinforced high copper friction material.</td>
<td class="clutch-info">The aramid friction exhibits 50% less wear than a conventional drive plate friction material.</td>
<td class="clutch-info">For the more advanced builds running higher power and for track use.</td>
</tr>
<tr>
<td class="clutch-info"><img src="https://rtsperformance.co.uk/wp-content/uploads/2021/11/RTS-6006SMF-HD-Plate.jpg" height="100%" width="100%" style="margin:auto;max-height:250px;max-width:250px"></td>
<td class="clutch-info"><img src="https://rtsperformance.co.uk/wp-content/uploads/2021/11/RTS-6006SMF-Twin-Friction-Plate.jpg" height="100%" width="100%" style="margin:auto;max-height:250px;max-width:250px"></td>
<td class="clutch-info"><img src="https://rtsperformance.co.uk/wp-content/uploads/2021/11/RTS-6006SMF-Paddle-Plate.jpg" height="100%" width="100%" style="margin:auto;max-height:250px;max-width:250px"></td>
</tr>
<tr>
<td class="clutch-attribute">Materials</td>
<td>Organic</td>
<td>Organic & Ceramic Pad</td>
<td>Ceramic Pad</td>
</tr>
<tr>
<td class="clutch-attribute">Power Rating</td>
<td>30%</td>
<td>60%</td>
<td>65%</td>
</tr>
<tr>
<td class="clutch-attribute">Track Use</td>
<td><span>✖</span></td>
<td><span>✔</span></td>
<td><span>✔</span></td>
</tr>
<tr>
<td class="clutch-attribute">Weight</td>
<td>4.5 kg</td>
<td>4.9 kg</td>
<td>5.1 kg</td>
</tr>
<tr>
<td class="clutch-attribute">Bedding In</td>
<td>200-300 Miles</td>
<td>750-1000 Miles</td>
<td>400-500 Miles</td>
</tr>
<tr>
<td class="clutch-attribute">Pedal Effort</td>
<td>Minimal</td>
<td>Minimal</td>
<td>Moderate</td>
</tr>
<tr>
<td class="clutch-attribute">Additional Information</td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
I want to display the table on mobile devices like the following:
#clutch-types td {
border: 1px solid #ddd;
}
#clutch-types {
width: 100%;
border-collapse: collapse;
}
#clutch-types td img {
display: block;
margin-left: auto;
margin-right: auto;
}
#clutch-types td {
text-align: center;
padding: 8px;
}
.clutch-attribute {
font-weight: bolder;
}
.clutch-info {
border: 0 !important;
background: #FFF;
}
#which-clutch-design {
word-spacing: 9999999px;
font-size: 30px;
color: black;
text-align: center;
padding: 10px;
}
.clutch-design {
padding: 10px
}
#clutch-types tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
<table class="clutch-types-mobile" id="clutch-types">
<tr>
<th rowspan="3">Which Clutch Design?</th>
<th class="clutch-design">HD (Organic)</td>
</tr>
<tr>
<td class="clutch-info">Reinforced high copper friction material.</td>
</tr>
<tr>
<td class="clutch-info"><img src="https://rtsperformance.co.uk/wp-content/uploads/2021/11/RTS-6006SMF-HD-Plate.jpg" height="100%" width="100%" style="margin:auto;max-height:250px;max-width:250px"></td>
</tr>
<tr>
<td class="clutch-attribute">Materials</td>
<td>Organic</td>
</tr>
<tr>
<td class="clutch-attribute">Power Rating</td>
<td>30%</td>
</tr>
<tr>
<td class="clutch-attribute">Track Use</td>
<td><span>✖</span></td>
</tr>
<tr>
<td class="clutch-attribute">Weight</td>
<td>4.5 kg</td>
</tr>
<tr>
<td class="clutch-attribute">Bedding In</td>
<td>200-300 Miles</td>
</tr>
<tr>
<td class="clutch-attribute">Pedal Effort</td>
<td>Minimal</td>
</tr>
<tr>
<td class="clutch-attribute">Additional Information</td>
<td></td>
</tr><tr>
<th rowspan="3"></th>
<th class="clutch-design">Twin Friction</td>
</tr>
<tr>
<td class="clutch-info">The aramid friction exhibits 50% less wear than a conventional drive plate friction material.</td>
</tr>
<tr>
<td class="clutch-info"><img src="https://rtsperformance.co.uk/wp-content/uploads/2021/11/RTS-6006SMF-Twin-Friction-Plate.jpg" height="100%" width="100%" style="margin:auto;max-height:250px;max-width:250px"></td>
</tr>
<tr>
<td class="clutch-attribute">Materials</td>
<td>Organic & Ceramic Pad</td>
</tr>
<tr>
<td class="clutch-attribute">Power Rating</td>
<td>60%</td>
</tr>
<tr>
<td class="clutch-attribute">Track Use</td>
<td><span>✔</span></td>
</tr>
<tr>
<td class="clutch-attribute">Weight</td>
<td>4.9 kg</td>
</tr>
<tr>
<td class="clutch-attribute">Bedding In</td>
<td>750-1000 Miles</td>
</tr>
<tr>
<td class="clutch-attribute">Pedal Effort</td>
<td>Minimal</td>
</tr>
<tr>
<td class="clutch-attribute">Additional Information</td>
<td></td>
</tr>
<tr>
<th rowspan="3" class="clutch-design"></th>
<th class="clutch-design">Paddle</td>
</tr>
<tr>
<td class="clutch-info">For the more advanced builds running higher power and for track use.</td>
</tr>
<tr>
<td class="clutch-info"><img src="https://rtsperformance.co.uk/wp-content/uploads/2021/11/RTS-6006SMF-Paddle-Plate.jpg" height="100%" width="100%" style="margin:auto;max-height:250px;max-width:250px"></td>
</tr>
<tr>
<td class="clutch-attribute">Materials</td>
<td>Ceramic Pad</td>
</tr>
<tr>
<td class="clutch-attribute">Power Rating</td>
<td>65%</td>
</tr>
<tr>
<td class="clutch-attribute">Track Use</td>
<td><span>✖</span></td>
</tr>
<tr>
<td class="clutch-attribute">Weight</td>
<td>5.1 kg</td>
</tr>
<tr>
<td class="clutch-attribute">Bedding In</td>
<td>400-500 Miles</td>
</tr>
<tr>
<td class="clutch-attribute">Pedal Effort</td>
<td>Morderate</td>
</tr>
<tr>
<td class="clutch-attribute">Additional Information</td>
<td></td>
</tr>
</table>
I am currently using:
.clutch-types-mobile {
display: none;
}
@media only screen and (max-width:440px) {
.clutch-types-mobile {
display: table;
}
.clutch-types-desktop {
display: none;
}
}
to display between the two however I would prefer using css to display the table in the mobile format. I have saw guides such as: https://css-tricks.com/responsive-data-tables/
and these work great, however doesn't display the table in the format i'd like.
Any help appreciated, cheers.