Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Width: CSS vs. tables

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  finding previous whois details for domain  
Author Message
ebakunin

External


Since: Sep 13, 2006
Posts: 3



(Msg. 1) Posted: Wed Sep 13, 2006 9:43 am
Post subject: Width: CSS vs. tables
Archived from groups: alt>www>webmaster (more info?)

Hello,

I'm trying to switch from using tables to CSS. One of the advantages of
tables is the "width" attribute, which will dynamically spread a table
across the browser screen. Therefore, when the browser window is
resized, the tables will resize as well. However, when width is used in
CSS, it statically sets the width of the element on the screen. When
the browser is resized, the element widths remain the same. For
example:

Using Tables:
|----30%----||----------70%-----------| browser in full screen mode

|--30%--||------70%-------| browser resized to a smaller window

Using CSS:
|----30%----||----------70%-----------| browser in full screen mode

|----30%----|
|----------70%-----------| browser resized to a smaller window forces
thesecond element to a lower row because of insufficient size


Does anyone have an idea of how to address this issue? Thanks.

 >> Stay informed about: Width: CSS vs. tables 
Back to top
Login to vote
ebakunin

External


Since: Sep 13, 2006
Posts: 3



(Msg. 2) Posted: Wed Sep 13, 2006 10:18 am
Post subject: Re: Width: CSS vs. tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

mbstevens wrote:
> On Wed, 13 Sep 2006 09:43:32 -0700, ebakunin wrote:
>
> > Hello,
> >
> > I'm trying to switch from using tables to CSS. One of the advantages of
> > tables is the "width" attribute, which will dynamically spread a table
> > across the browser screen. Therefore, when the browser window is resized,
> > the tables will resize as well. However, when width is used in CSS, it
> > statically sets the width of the element on the screen. When the browser
> > is resized, the element widths remain the same. For example:
> >
> > Using Tables:
> > |----30%----||----------70%-----------| browser in full screen mode
> >
> > |--30%--||------70%-------| browser resized to a smaller window
> >
> > Using CSS:
> > |----30%----||----------70%-----------| browser in full screen mode
> >
> > |----30%----|
> > |----------70%-----------| browser resized to a smaller window forces
> > thesecond element to a lower row because of insufficient size
> >
> >
> > Does anyone have an idea of how to address this issue? Thanks.
>
> You need to post a URI so we can look at it.
> It could be that you have some element
> in the 30% section that is wider than 30% of the window at the smaller
> size. These things also behave differently when you are floating the 70%
> section versus when you position it using a wide margin. All sorts of
> things could be going on. So we really have to see the URI.

I'm running the page natively and the client would not be happy if I
threw the site up before it was ready. But that does help a bit. Is the
width attribute based on the parent's values or the document's values?
Thanks for the help.

 >> Stay informed about: Width: CSS vs. tables 
Back to top
Login to vote
mbstevens

External


Since: Jun 30, 2006
Posts: 43



(Msg. 3) Posted: Wed Sep 13, 2006 5:04 pm
Post subject: Re: Width: CSS vs. tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 13 Sep 2006 09:43:32 -0700, ebakunin wrote:

> Hello,
>
> I'm trying to switch from using tables to CSS. One of the advantages of
> tables is the "width" attribute, which will dynamically spread a table
> across the browser screen. Therefore, when the browser window is resized,
> the tables will resize as well. However, when width is used in CSS, it
> statically sets the width of the element on the screen. When the browser
> is resized, the element widths remain the same. For example:
>
> Using Tables:
> |----30%----||----------70%-----------| browser in full screen mode
>
> |--30%--||------70%-------| browser resized to a smaller window
>
> Using CSS:
> |----30%----||----------70%-----------| browser in full screen mode
>
> |----30%----|
> |----------70%-----------| browser resized to a smaller window forces
> thesecond element to a lower row because of insufficient size
>
>
> Does anyone have an idea of how to address this issue? Thanks.

You need to post a URI so we can look at it.
It could be that you have some element
in the 30% section that is wider than 30% of the window at the smaller
size. These things also behave differently when you are floating the 70%
section versus when you position it using a wide margin. All sorts of
things could be going on. So we really have to see the URI.
 >> Stay informed about: Width: CSS vs. tables 
Back to top
Login to vote
mbstevens

External


Since: Jun 30, 2006
Posts: 43



(Msg. 4) Posted: Wed Sep 13, 2006 6:01 pm
Post subject: Re: Width: CSS vs. tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 13 Sep 2006 10:18:39 -0700, ebakunin wrote:
> Is the width
> attribute based on the parent's values or the document's values? Thanks
> for the help.

Pardon my being pedantic, but you'll probably want to know this:
You are confusing an HTML element's attributes with CSS properties
that can apply to an HTML element. I imagine that they were given
different names to help us separate our thinking about the two
very different ways of positioning elements.

Percentage values for the width property refer to the parent element's
width. (Reference to the parent element does not apply to all styles.)
 >> Stay informed about: Width: CSS vs. tables 
Back to top
Login to vote
Ben Jamieson

External


Since: Mar 19, 2005
Posts: 67



(Msg. 5) Posted: Thu Sep 14, 2006 11:59 pm
Post subject: Re: Width: CSS vs. tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2006-09-13 12:43:32 -0400, ebakunin.TakeThisOut@gmail.com said:

> Does anyone have an idea of how to address this issue? Thanks.

Just a guess, but is there any chance you have padding in either of the
HTML elements you are styling with CSS?

It may not be the case, but one thing that catches many out with CSS is
the way the box model works.

In the case of, say, a div with a width of 70% and padding set to 5px,
the width of the final div will be 70%, plus 5px on the left, plus 5px
on the right, making it more than 70%

This can cause unexpected wrapping along the way....

Might be irrelevant, but like I said - its just a guess....


--
Thyme Online Ltd
Caribbean Web Design
http://www.thymeonline.com/
 >> Stay informed about: Width: CSS vs. tables 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Why CSS is better than Tables... - OK I know this has been discussed to death, and well I personally am a near complete convert BUT on a new site, I need to present the BUSINESS case for why CSS is better than tables for layout... this btw is for a fairly large organisation who pride....

JS/CSS/Tables Help - Can anyone see what I'm overlooking? On this page, the popups (on the Site Admin and Calendar Text items) have an opaque background and a nice, thin border, as they should: http://development2.holotech.net/portal/test/ This page is using essentially....

CSS min-width for IE? - Hi guys. I want to use 'min-width' on a new site to prevent the navigation being ruined in a window smaller than 640px across. body { min-width: 640px; } Works great in Opera, as all good things do, but has no effect in IE 6. Anybody know of a work....

tables are best - noooo, not that sort ;) Can any of the *n*x gurus resident in these parts point to a comprehensive guide to iptables for a complete noob? Been troubleshooting, examining the rules in a firewall and now I'm more befuddled than I was before. -- ..

Tables, tables everywhere! - Hi all. Newbie-dude here again. Just beginning my html coding experience. Eventually I'm looking to do this professionally. I often hear that tables for layout are passe and I should be using css. 2 problems with that so far. 1. Virtually every..
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]