Click here to get back home

Looking for advice in a CSS layout instead of tables

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Looking for advice in a CSS layout instead of tables Jeremy J Starcher 04-04-2008
Posted by Jeremy J Starcher on April 4, 2008, 3:39 am
Please log in for more thread options
I have an example page

<URL: http://parts.mopedepot.com/test/test1.html >

that uses tables for its layout.

<table>
<td>Space holder</td>
<td>Skip scroll bars, since those are "outside" my reserved space</td>
<td>Graphic image</td>
</table>

The parts list that shows on that page is placed there with absolute
positing. Anyone willing to give me pointers on how to change this over
to a CSS-based design? I tried making the image a "position:fixed" div,
but then I lost the scroll bars on my browser -- making that less than an
ideal solution.

Am I overlooking something obvious, like some sort of a 'no-break' option
for divs to keep them glued side by side? Or is there another approach I
should take?

Thanks!

Posted by Ben Bacarisse on April 4, 2008, 11:48 am
Please log in for more thread options

> <URL: http://parts.mopedepot.com/test/test1.html >
>
> that uses tables for its layout.
>
> <table>
> <td>Space holder</td>
> <td>Skip scroll bars, since those are "outside" my reserved space</td>
> <td>Graphic image</td>
> </table>
>
> The parts list that shows on that page is placed there with absolute
> positing. Anyone willing to give me pointers on how to change this over
> to a CSS-based design? I tried making the image a "position:fixed" div,
> but then I lost the scroll bars on my browser -- making that less than an
> ideal solution.

position: fixed is rarely the solution for anything. It has very
limited use because of what it does to the element (it get taken out
of the normal flow).

> Am I overlooking something obvious, like some sort of a 'no-break' option
> for divs to keep them glued side by side? Or is there another approach I
> should take?

The most usual way to one thing beside another -- using CSS -- is to
float on of them. Often you float one think into the margin of the
other. This is how I'd tackle your situation. I'd keep the table of
parts as a table, of course, since it *is* a table but I would float
it left and ensure that the element that contains the image has a
margin wide enough to hold the table.

If your pages are such that the width of the table is more variable
than that of the images, you might want to do it the other way
round -- float the image right.

--
Ben.

Posted by Jeremy J Starcher on April 4, 2008, 12:51 pm
Please log in for more thread options
On Fri, 04 Apr 2008 16:48:42 +0100, Ben Bacarisse wrote:


[ Jeremy's summary snipped ]
>
> position: fixed is rarely the solution for anything. It has very
> limited use because of what it does to the element (it get taken out of
> the normal flow).
>
>> Am I overlooking something obvious, like some sort of a 'no-break'
>> option for divs to keep them glued side by side? Or is there another
>> approach I should take?
>
> The most usual way to one thing beside another -- using CSS -- is to
> float on of them. Often you float one think into the margin of the
> other.

Brilliant!

As you can tell, I'm still learning CSS. So far I've gotten by by
pretending margins and borders don't exist. ;)

That gives me a good direction on where to start.

Thanks.


Similar ThreadsPosted
Advice needed for HTML layout August 11, 2004, 9:53 pm
Problems with tables and layout in Firefox January 4, 2006, 11:01 pm
How to make layout without tables (using div's)... February 7, 2006, 9:07 am
tables for layout bugs question November 1, 2006, 9:33 am
No TABLES in html. No hacks in CSS. Any layout possible, crossbrowser. Try it. December 30, 2007, 7:42 am
free HTML editor/divs and not tables for layout? January 13, 2008, 10:00 am
Three column layout, middle column clear:both; affects other two columns;no tables March 9, 2007, 11:31 pm
Need some advice... September 24, 2004, 6:27 pm
CMS advice October 28, 2006, 7:24 pm
Update help and advice please September 12, 2007, 5:37 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap