i have been browsing here for probably 10 years, dont know how it took this long to make an account to ask my own question. Here it is:
I have the following liquid code:
<table data-mce-fragment="1" width="100%">
<td data-mce-fragment="1" style="width: 50%;">{{ 'https://cdn.shopify.com/s/files/1/0556/5258/1539/files/windows-logo.png'| img_tag: 'Windows Compatible Operating Systems' }} Windows Compatible Operating Systems<br><br>
{{ product.metafields.custom.windows_compatible_operating_systems_3_0 }}</td>
<td data-mce-fragment="1" style="width: 50%;">{{ 'https://cdn.shopify.com/s/files/1/0556/5258/1539/files/mac-logo.png?v=1707807667'| img_tag: 'Mac Compatible Operating Systems' }} Mac Compatible Operating Systems<br><br>
{{ product.metafields.custom.mac_compatible_operating_systems_3_0 }}</td>
</tr>
</tbody>
</table>
It is outputting like my attached image.
It is vertically unaligned.
Question is, how can I get the windows column vertically align to top with the mac column?
Im assuming Mac column is higher up due to longer text.
2
Answers
That worked great!. Next request.
Here is updated code:
New screenshot attached.
How can I get each the windows and mac headers vertically aligned center with their corresponding image?
enter image description here
I don’t know liquid Library, but you can use the below solution when your application only works on web browser.
Use
vertical-align
options for eachtd
tag.vertical-align
option might work if you didn’t changetd
tag’s display property.(documentation for vertical-align, https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align)