I am trying to align large text on either side of the center of the page. For instance:
Current Recommendation: Open
Current Status: Closed
But imagine that the text is centered and larger.
The only way I have been able to do this so far is through a table, but I know that this is not a modern approach to web layouts. Here's jsfiddle: https://jsfiddle.net/nyLLzy1m/3/
Is there a way to do this in HTML and CSS without a table? I tried spaces with a float left and right, but then the text floats all the way to the right or left, and not to the right or left of the center.
p {
margin: 0;
}
<table cellpadding="0" cellspacing="0" width="100%" style="border: 1px;" rules="none">
<tbody>
<tr>
<td align="right" width="50%" style="padding-right: 5px;">
<p style="font-size: 20px;">Current Recommendation:</p>
</td>
<td align="left" width="50%" style="padding-left: 5px;">
<p style="font-size: 20px;">Open</p>
</td>
</tr>
<tr>
<td align="right" width="50%" style="padding-right: 5px;">
<p style="font-size: 20px;">Current Status:</p>
</td>
<td align="left" width="50%" style="padding-left: 5px;">
<p style="font-size: 20px;">Closed</p>
</td>
</tr>
</tbody>
</table>
Run codeHide result
source
share