I can't figure out the difference between valign vs text-align in HTML in context with the following code:
<table width="500" border="0">
<tr>
<td colspan="2" style="background-color:#FFA500;">
<h1>Main Title of Web Page</h1>
</td>
</tr>
<tr valign="top">
<td style="background-color:#FFD700;width:100px;text-align:top;">
<b>Menu</b><br />
HTML<br />
CSS<br />
JavaScript
</td>
<td style="background-color:#EEEEEE;height:200px;width:400px;text-align:top;">
Content goes here</td>
</tr>
<tr>
<td colspan="2" style="background-color:#FFA500;text-align:center;">
Copyright © 2012</td>
</tr>
</table>
valign
(html attribute) is equivalent of vertical-align
in css
align
(html attribute) is equivalent of text-align
in css
html attribute versions are deprecated in favour of css
vertical-align
positions block elements (e.g. div
) vertically inside other block elements
text-align
positions inline elements (e.g. span
, default text) inside block elements horizontally
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With