[css-d] Vertical centering in a table cell using CSS
Is there a way to vertically center content in a table cell using CSS (not HTML)? Sam __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Vertical centering in a table cell using CSS
> Is there a way to vertically center content in a table cell using CSS > (not HTML)? A CSS table cell or an HTML table cell? CSS: [assume markup -> ] .vcenter {display: table-cell;vertical-align: middle;height: 100%;} HTML: [assume markup -> ] .vcenter {vertical-align: middle;} __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Vertical centering in a table cell using CSS
okay, so slightly OT here... could someone explain the use of display:table-cell? I can never seem to get my brain around the how's and why's Like, why wouldn't you use a table instead of divs acting like tables and table cells? thanks! >> Is there a way to vertically center content in a table cell using CSS >> (not HTML)? > > A CSS table cell or an HTML table cell? > > CSS: > [assume markup -> ] > .vcenter {display: table-cell;vertical-align: middle;height: 100%;} > > HTML: > [assume markup -> ] > .vcenter {vertical-align: middle;} __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Vertical centering in a table cell using CSS
CJ Larson wrote: >>Is there a way to vertically center content in a table cell using CSS >>(not HTML)? >> >> > >A CSS table cell or an HTML table cell? > > This is a cell >CSS: >[assume markup -> ] >.vcenter {display: table-cell;vertical-align: middle;height: 100%;} > > > This doesn't seem to center vertically in either IE 6 or Firefox... My mistake or is there a correction? Sam __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Vertical centering in a table cell using CSS
>This doesn't seem to center vertically in either IE 6 or Firefox... Do you have a sample page online? I noticed you cut out the HTML example from my original reply and only left in the CSS one. Are you sure you were using the right example? The full code for my td table was more like this (I'm only using inline styles for simplicity in emails): hello world __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Vertical centering in a table cell using CSS
Why do you need this style="height: 100%;vertical-align: middle;" at all? Isn't the default for vertical alignment in a cell center? If you don't do anything, and haven't set anything in your CSS, the cell should be vertically centered by default. Marjorie MacDonald --- CJ Larson <[EMAIL PROTECTED]> wrote: > >This doesn't seem to center vertically in either IE > 6 or Firefox... > > Do you have a sample page online? > > I noticed you cut out the HTML example from my > original reply and > only left in the CSS one. Are you sure you were > using the right > example? The full code for my td table was more > like this (I'm only > using inline styles for simplicity in emails): > > > hello > world > > > __ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/