CSS and center align

S

shank

I have a table cell with a nested table within.
How do I center that nested table within that cell?

I found { vertical-align:middle }
But { horizontal-align:center } seems to be invalid

Is it proper to use { text-align:center } ..?

thanks
 
S

SeeSchloss

"shank" a écrit :
I have a table cell with a nested table within.
How do I center that nested table within that cell?

I found { vertical-align:middle }
But { horizontal-align:center } seems to be invalid

Is it proper to use { text-align:center } ..?

Yes, 'horizontal-align' does not exist.
 
B

brucie

I have a table cell with a nested table within.
How do I center that nested table within that cell?

don't use tables for layout. much easier and can achieve layouts not
possible any other way with CSS
I found { vertical-align:middle }

IME one of CSS great oversights was not to allow vertical-align on any
element
But { horizontal-align:center } seems to be invalid

you cant make things up and expect them to work
Is it proper to use { text-align:center } ..?

horizontally yes. there is no one solution for vertically, depends on
your design.
 
D

DU

shank said:
I have a table cell with a nested table within.

Avoid nested tables for positioning and layout.
How do I center that nested table within that cell?

text-align:center for inline elements; margin:0 auto for block-level
elements.
I found { vertical-align:middle }
But { horizontal-align:center } seems to be invalid

Is it proper to use { text-align:center } ..?

thanks

It is definitively not recommendable to use nested tables or just to use
a single table for positioning elements or for webpage layout. You
should use a table for tabular data otherwise you will make your page
much more difficult to consult in several devices.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 
S

shank

DU said:
Avoid nested tables for positioning and layout.


text-align:center for inline elements; margin:0 auto for block-level
elements.


It is definitively not recommendable to use nested tables or just to use
a single table for positioning elements or for webpage layout. You
should use a table for tabular data otherwise you will make your page
much more difficult to consult in several devices.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html


Nested tables have worked very well in the past and, until I get migrated to
100% CSS, will work fine in the future. Since I've started researching the
move to CSS I've noticed that many of the recommended sites for learning CSS
still use tables. If it's so great, why not lose the tables altogether? Even
the pros on the internet and in this newsgroup cannot agree on all aspects
of CSS. For sure, our customers still have antiquated browsers. Although the
upgrades are free, they are likely not going to upgrade very soon. That
said, even if I was able to get 100% CSS, I'd have to account for all those
old browsers somehow. Do I believe CSS will take over? Yep... just not as
quick as some of you would like.
This newsgroup is still great!
Thanks!
 
D

DU

shank said:
Nested tables have worked very well in the past and, until I get migrated to
100% CSS, will work fine in the future.

We are talking about nested tables here. Try them with screen readers,
voice browsers, text-to-speech devices, printing, (handheld/wireless
media) mobile phone, etc...

Since I've started researching the
move to CSS I've noticed that many of the recommended sites for learning CSS
still use tables.

1) Are we talking about
Tables or
nested tables?
2) Are we talking about using a non-nested table for tabular data or are
we talking about using table(s) for positioning and layout?

Report back in this thread when you can clarify these questions along
with your "many of the recommended sites".

Here's a few for starters:

http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-avoid-table-for-layout
http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-table-layout
http://www.w3.org/TR/WAI-WEBCONTENT-TECHS/#tech-avoid-table-for-layout
WAI HTML Table Linearizer Entry Form
http://www.w3.org/WAI/References/Tablin/form


If it's so great, why not lose the tables altogether? Even
the pros on the internet and in this newsgroup cannot agree on all aspects
of CSS. For sure, our customers still have antiquated browsers.

So? Content should degrade in case CSS is not supported.
13 Using style sheet positioning and markup to transform gracefully
http://www.w3.org/TR/WCAG10-CSS-TECHS/#style-transform-gracefully

Although the
upgrades are free, they are likely not going to upgrade very soon. That
said, even if I was able to get 100% CSS, I'd have to account for all those
old browsers somehow.

It's only possible to discuss this in general terms since you have not
provided any url so far.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 
Joined
Dec 30, 2008
Messages
1
Reaction score
0
I am having same problem I want to align Center Horizontallly I am having Dhtml Menu which i want to center in table cell, but did not find any solution in css.
At moment I am using <center> tag to align Menu to <center> But I want it in Css.

thanks for your help in advance...

Imam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top