Hello everyone,
I am seeking the most straightforward method to achieve a basic layout using HTML and CSS that resembles the image in this link: https://i.sstatic.net/e6kuB.png
To be more specific, I need a label aligned to the right on the left side, and a value aligned to the left on the right side. It is important not to set a fixed width for the left column as it should adjust based on the longest label.
The solution should maintain semantic structure, work well with screen readers (reading label followed by value), and avoid excessive use of extra <div>
elements.
This type of layout is quite common, so there must be a very simple way to achieve it. However, I have yet to discover it myself.
While a <table>
could handle this layout effectively, I understand the recommendation to avoid using tables for purely visual purposes when the data is not tabular.
Thank you in advance!