Hi everyone,
I need some help with setting the align inside a CSS file.
For example I have this:
and I want it to be aligned to the center.Code:<tr class='thead'>...</tr>
I'm new to CSS so please be gentle.
Thanks for any help!
Chen.
| SitePoint Sponsor |
Hi everyone,
I need some help with setting the align inside a CSS file.
For example I have this:
and I want it to be aligned to the center.Code:<tr class='thead'>...</tr>
I'm new to CSS so please be gentle.
Thanks for any help!
Chen.





Simple:Code:.thead { text-align: center; // I suppose that you would like the text // to be in the middle of the cell, as well. // Don't rely on this too much, because it // doesn't work. ;-) (the browser’s haven't // implemented yet, that is) vertical-align: middle; }
Thanks a lot Ian!![]()





Hey, so I guess it worked. ;-)
Anyway, I'm always glad to be helpful.
Yes of course, worked splendid!
Now to solve my other problems... *sigh*





No need for CSS in this case...
<tr class='thead' align="center">...</tr>
That will center align the contents of every TD tag in that row.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes





So will doing that with CSS. :-pOriginally posted by creole
No need for CSS in this case...
<tr class='thead' align="center">...</tr>
That will center align the contents of every TD tag in that row.
Don't let yourself be swayed by the dark (4.0) way! Ignore Creole; he's old and cranky. :-)





Not cranky...just old. Right now CSS is unreliable for many things. my method will work the same in every browser.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
I know you can do it that way creole, it's just that I have a lot of rows like this, and it's a pain to write that attribute so many times when I can just stick it in my .css file.Originally posted by creole
<tr class='thead' align="center">...</tr>
Thanks though.![]()





It also clutters up your page. And besides, I can give you a few browsers where that tactic doesn't work (o.k. so most of them are non graphical, but still it applies). ;-)





This is very true FireFly...
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
I'm sorry, was that directed at my method or creole's?Originally posted by Ian Glass
It also clutters up your page. And besides, I can give you a few browsers where that tactic doesn't work (o.k. so most of them are non graphical, but still it applies). ;-)
My script is currently for personal use only, so I don't have to worry too much about compatibility. At least not in this stage...
By the way thanks for all your feedback!





He was talking about my method.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes





Sure was. :-p




the W3C doesn't like it when you specify an align attribute in a table or table row so if you want to go with the W3C guidelines use CSS
Bookmarks