I am encountering a very specific issue with a web view I am designing for mobile devices. Within the webview, I have a table
that is being re-arranged vertically for smartphone screens. To achieve this rearrangement, I hide the table
header and use the column name as a :before
pseudo element from a data-label
attribute on the original HTML element.
The problem arises when the pseudo element and the content in the td
do not align vertically, despite both elements being floated in opposite directions. It seems that the length of the text within the td
element is causing this misalignment, but I am unsure of the exact reason behind it.
Attached below is an image illustrating the issue:
https://i.sstatic.net/kTTsm.png
This is how my HTML is structured:
https://i.sstatic.net/aVvaI.png
Here is the computed CSS code for reference:
td
Style
https://i.sstatic.net/STBu2.png
:before
Style
https://i.sstatic.net/McMv1.png
If anyone can provide insight into why this alignment issue is occurring and what adjustments need to be made to rectify it, I would greatly appreciate it.
Thank you in advance.