Hey. I'm designing a website and I'm having some trouble aligning some text. The text is placed inside a table, and automatically, it is positioned in the middle of the table. I want the text to be placed in the top of the table. I've tried the vertical-align css function, but I can't seem to get it to work. Of course I could make a lot of underneath the text, but does anybody know how to do this in a nicer way? Thanks
You really should show at least a minimal test case that shows what you've done, both the html and the css. Without knowing about any mitigating circumstance, I can only suggest td {vertical-align: top;} Code (markup): cheers, gary
If it's in a table, place valign="top" in the <td> tag. i.e. <td valign="top"> I hope your not using tables to design the layout of your site though. If you are, use divs instead.
Table etc.. will look like this <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="60%" valign="top"> or whatever % you choose <p align="left"> or <div align="left">TEXT TEXT TEXT etc...... then closing tags
Great, thanks guys. I've made it work now. I had assigned the vertical-align function to a class instead of the td tag. Thats what I did wrong. Thanks again
You could if you don't have any users with IE. IE<8 does not support any of the table group values of the display property. cheers, gary
XHTML CSS without tables is much better than tables. Tableless design are W3C Compliant and you can change this kind of things.