PDA

View Full Version : vertical alignment in a table cell


Kimber
06-04-2004, 02:27 AM
I'm sure I used to know how to do this, but it's been a long time since I've used tables, and now it's driving me nuts. I have a couple of paragraphs of text floating around in the middle of a table cell, and I want it at the top, dammit!

Any advice would be appreciated.

Thanks, Kimber

DCElliott
06-04-2004, 02:53 AM
Put valign="top" in your <td>.

For more complete table help try the tutorials at W3CSchools: http://www.w3schools.com/html/html_tables.asp

DE

Kimber
06-04-2004, 02:57 AM
Ooh! Thankyou, thankyou, thankyou!

And why I didn't think to go back to w3schools, I don't know. I use it all the time for css......

*slaps forhead*

Ta, Kimber

nmpoet
06-04-2004, 06:08 AM
I have an image challenge somewhat along the same lines - I'm trying to align a footer flush against the bottom of the page however it keeps giving me a small white space between the image itself and the bottom of the page. As it is now, I've got it set up in a table w/ the valign tag set to bottom but it's not flush. Can anyone help me with this? It doesn't necessarily have to be in a table if css will work or some other trick. I'm just learning all this stuff but it's going well! Thanks in advance :)
P.S. I did check out the site mentioned but couldn't find the help I needed...

DCElliott
06-04-2004, 06:22 AM
Nita, could you post a link to what you are working on? You have to have the image as display:block or else it will be displayed as :inline which will leave some space at the bottom.

Incidently, I looked at your poetry site and would ask that you try the following CSS on for size:INPUT, SELECT, TEXTAREA {width:65%;
max-width:30em;
background: url("http://www3.ns.sympatico.ca/d.elliott/black_trans.gif");
color: #F0F0F0;
font-family: Papyrus,'Tempus Sans ITC', Verdana, Humanist, sans-serif;
font-size: .9em;
border: 0;
padding: 5px;
}If you like the effect, please feel free to copy the background graphic to your site which will give a semitransparent black background.

DE

nmpoet
06-04-2004, 06:42 AM
Oh thanks David - the url is: http://www.geocities.com/elinorvillani It's just a lil page for my Mom who wants her own space on the internet at age 70! :) I've been putzing with it and have changed the footer to a css code but it's not working either so anything you can advise will be so appreciated! And, I will most certainly give your css code for my site a try later today, thanks so much!

DCElliott
06-04-2004, 07:29 AM
Nita

Your poetry is far better than your html and css ;)

Try for your footer html:
<div id="footer">
</div>
for your css:
body {
margin:0;
padding:0;
/*control your page font here rather than in the body tag
always provide a full list of eligible fonts ending with a default*/
font:normal normal 85%/1.2 'tempus sans itc', tahoma, verdana, humanist, sans-serif;
}
#header {
margin: 0;
padding: 0;
height: 200px;
}
#center {
top: 0;
margin:0 auto; /*this will provide automatic centering in most browsers*/
width:40em; /*this is the max comfortable line length for most folks*/
max-width:90%; /*this prevents the width from being too wide on a narrow window*/
}

#footer {
margin-bottom: 0;
padding: 0px;
height: 50px;
background:transparent url(Footer.jpg) repeat-x left bottom;
}By making the footer image a background that is attached to the bottom of the footer div, it is guaranteed to stay at the bottom. You could add text to the footer and it would push the grey graphic downwards.

Incidently, you get a geocities advertisement at the bottom so the footer will never really be "bottom".

You should take all the <font> codes out of the document and control everything with the CSS - that is what it is for!

OK - enough butting in ;)

DE

nmpoet
06-04-2004, 10:34 AM
LOL - I do not earn my living designing websites and it's very obvious :) Copy & Paste girl here...
Thanks so much David for your help with this.