Struggling to convert tables to CSS

This is a discussion on "Struggling to convert tables to CSS" within the Web Page Design section. This forum, and the thread "Struggling to convert tables to CSS are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 10th, 2007, 11:19
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Struggling to convert tables to CSS

I'm trying to figure out if it's possible to convert the tables at http://wickedmoon.com/wickedmoon_v2b.php into CSS. I've put some descriptions on the page next to the graphics. One of the graphics needs to be tiled, but only as far as the page content goes. The content needs to overlay this graphic. Tables make it easy to do, as I can set the graphic as a table background. As I add more content to the table cell, more of the graphic is revealed and the image is designed to tile seamlessly down the page.

Jason
Reply With Quote

  #2 (permalink)  
Old Aug 10th, 2007, 11:32
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

For some reason this stupid firewall at work is blocking the site

But ... ALL site can be converted to CSS

Resources for learning how to use CSS for layout
Reply With Quote
  #3 (permalink)  
Old Aug 10th, 2007, 11:35
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Thanks for the reassurance I have some experience with CSS, but this is beyond me.
Reply With Quote
  #4 (permalink)  
Old Aug 10th, 2007, 11:37
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

If you could give a nice clean screenshot I can point you in the right direction, then going to the link I posted above there are a bunch of example of css layouts you can use and re-arrange.
Reply With Quote
  #5 (permalink)  
Old Aug 10th, 2007, 11:42
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

The page is too long really for a snapshot. I've attached the source code below if you can use that?

Jason

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Wicked Moon</title>


<meta name="Description" content="" />
<meta name="Keywords" content="" />


<link href="style2.css" rel="stylesheet" type="text/css" />
</head>

<body bgcolor="#330000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<p align="center">Header</p>
<p align="center">Ecards. Videos. Games. Pictures. Forum.</p>
<p align="center">Username: 
  <input name="textfield" type="text" class="textfield" size="20" />
  Password: 
  <input name="textfield" type="text" class="textfield" size="20" />
Login. Sign up. Lost password. </p>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="gfx/layout2007summer/scroll_top.jpg" width="995" height="93" /></td>
  </tr>
  <tr>
    <td background="gfx/layout2007summer/scroll_middle.jpg"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="120" valign="top"><p>Left column</p>
      </td>
    <td valign="top">
<h1 align="center">Page title</h1>
<p align="center">Main page content. </p>
<p align="center">300x250 pixel advert is right justified, with page content wrapped around it to the left and underneath: </p>
<script type="text/javascript"><!--
google_ad_client = "pub-9248981396278238";
google_alternate_color = "FFFFFF";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "9999FF";
google_color_bg = "FFFFFF";
google_color_link = "940F04";
google_color_text = "003366";
google_color_url = "063E3F";
google_ui_features = "rc:6";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</td>
    <td width="120" valign="top"><p>Right column </p>
      <p>New users</p>
      <p>Who's online </p></td>
  </tr>
</table></td>
  </tr>
  <tr>
    <td><img src="gfx/layout2007summer/scroll_bottom.jpg" width="995" height="76" /></td>
  </tr>
</table>
<p align="center" class="text_borders_small"><a href="http://rydia.net">Hosting 
managed by Rydia.net</a></p>
<p align="center" class="text_borders_small">&copy; <a href="http://wickedmoon.com">Wicked Moon</a> 2007. All rights reserved.</p>
<p align="center" class="text_borders_small">&nbsp;</p>
<p align="center">Breakdown of page:</p>
<p align="center">Top of scroll:</p>
<p align="center"><img src="gfx/layout2007summer/scroll_top.jpg" width="995" height="93" /></p>
<p align="center">Middle of scroll: </p>
<p align="center">The middle of the scroll needs to tile down the page. The image is designed to tile seamlessly. How far it tiles should depend on how much page content there is. This is easily acheived with tables. The image is set as the table background, so the more content is added to that table cell, the more of the scroll is visible and it just continues to tile. There is never more scroll than necessary. When the page content ends, the scroll ends.</p>
<p align="center">Page content needs to overlay the middle of the scroll using CSS. Content shouldn't overlay the top and bottom scroll graphics. Content can overlap the left and right edges of the middle of the scroll, so it goes across the page. I am going to fade out the sides of the scroll, so this will look ok.</p>
<p align="center"><img src="gfx/layout2007summer/scroll_middle.jpg" width="995" height="384" /></p>
<p align="center">Bottom of scroll:</p>
<p align="center">The middle of the scroll ends with the following image. This is designed to look good no matter where the middle of the scroll is cut off by the table. </p>
<p align="center"><img src="gfx/layout2007summer/scroll_bottom.jpg" width="995" height="76" /> </p>
<p align="center" class="text_borders_small">&nbsp;</p>
</body>
</html>
Reply With Quote
  #6 (permalink)  
Old Aug 10th, 2007, 11:45
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

I need a visual .... Firefox has a nice Screengrab! extension which allows you to grab the complete page
Reply With Quote
  #7 (permalink)  
Old Aug 10th, 2007, 11:59
Up'n'Coming Member
Join Date: Aug 2007
Location: Bicester
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Hi

Basically I think as karinne says this should be easy. If you can flow your div elements the middle one with the expanding image can have background-image:url(middle.jpg) ; background-repeat: repeat-y;

To get the 3 columns of your inner table you use something like:

<div style="float:left;width:200px;" >col 1 </div>
<div style="float:left;width:200px;" >col 2 </div>
<div style="float:left;width:200px;" >col 3 </div>

To get the overall effect is going to be difficult becuase of your nested tables. Maybe if you put the above 3 columns in a div with the background set as above that would work: something like:

Code: Select all
<html>
<body>
<div id="top" style="background-image:url(top.jpg) ;background-repeat:no-repeat;">
top

</div>
<div id="miiddle" style="background-image:url(middle.jpg) ; background-repeat: repeat-y;" >
<div style="float:left;width:200px;" >col 1 </div>
<div style="float:left;width:200px;"  >col 2 </div>
<div style="float:left;width:200px;"  >col 3 </div>
</div>
 
<div id="bottom" style="clear:both;style="background-image:url(bottom.jpg) ;background-repeat:no-repeat;">">

bottom
</div>
</body>
</html>
regards
Justin

Last edited by Kropotkin; Aug 10th, 2007 at 12:05.
Reply With Quote
  #8 (permalink)  
Old Aug 10th, 2007, 12:22
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Here's some code for ya... it's similar to Justin's but I do it a bit differently. See if either of these shed light on your situation.

I didn't add a footer at the bottom. I figured you could do that. Just be sure if you use a footer div, you add a clear:both; to it because the div's above it are floated.
Keep what you have for code and add this to the css:
CSS
Code: Select all
#scrolltop {
    width: 995px;
    height: 93px;
    margin: 0 auto; <!--centers scrolltop -->
    }
#wrapper {
    width: 995px;
    margin: 0 auto;
    background-image:url(gfx/layout2007summer/scroll_middle.jpg) repeat-y;
    }    
    
#left {
    width: 150px;
    float: left;
    }    
#middle {
    width: 695px;
    float: left;
    }
#right {
    width: 150px;
    float: left;<!--this can be floated right ...doesn't matter.  Next bit of code must have a clear added to it. --> 
    }
Html
Code: Select all
<body bgcolor="#330000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<p align="center">Header</p>
<p align="center">Ecards. Videos. Games. Pictures. Forum.</p>
<p align="center">Username: 
  <input name="textfield" type="text" class="textfield" size="20" />
  Password: 
  <input name="textfield" type="text" class="textfield" size="20" />
Login. Sign up. Lost password. </p>
<div id="scrolltop"><img src="gfx/layout2007summer/scroll_top.jpg" width="995" height="93" /></div>
<div id="wrapper">
    <div id="left">Left Column</div>
    <div id="middle"> 
      <p>All your page content here</p>
     
    </div>
    <div id="right">Right column</div>

</div><!--end wrapper div -->
<div id="scrollbottom"><img src="gfx/layout2007summer/scroll_bottom.jpg" width="995" height="76" /></div>
Reply With Quote
  #9 (permalink)  
Old Aug 10th, 2007, 14:03
Junior Member
Join Date: Jul 2007
Location: Dallas, TX
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Re: Struggling to convert tables to CSS

I commend your decision to move to CSS, but first you need to have a basic undersstanding of how it works before actually building live sites.

Try reading some posts in this forum, or, better yet try www.w3schools.com.

This is what your page looks like in IE6:

Once again, test your pages in more than one bowser. If your pages completely bomb on the most used browser on the Internet, there really is no point in asking for help to tweak a design.
Attached Images
File Type: jpg ie6grab002.jpg (84.2 KB, 19 views)
Reply With Quote
  #10 (permalink)  
Old Aug 10th, 2007, 14:04
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Thanks for the firefox add-on, nice I think we have it sorted with the existing posts, I'm going to try them now.
Attached Images
File Type: jpg wickedmoon.jpg (88.6 KB, 16 views)

Last edited by wickedmoon; Aug 10th, 2007 at 14:06.
Reply With Quote
  #11 (permalink)  
Old Aug 10th, 2007, 14:10
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Quote:
Originally Posted by Skelbo View Post
Once again, test your pages in more than one bowser. If your pages completely bomb on the most used browser on the Internet, there really is no point in asking for help to tweak a design.
That's how it's meant to look, it's only a test page
Reply With Quote
  #12 (permalink)  
Old Aug 10th, 2007, 14:11
Junior Member
Join Date: Jul 2007
Location: Dallas, TX
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Anyway...I never answered your question in my previous post.

Here's how I would solve this problem.
  • I would make the page into 3 basic DIVs
  • The top DIV would contain the top of the scroll.
  • The middle DIV would have the expandable paper set as the background and the text would be constrained within so it doesn't go past the 'paper' edge
  • The bottom DIV contains the bottom of the scroll
Using this method, as the content got longer, the 'paper' would tile and give the appearance of expanding the scroll. It's kind of like pulling down a window blind...

I won't actually write the code FOR you, but that should get you pointed in the right direction.

I hope this helps.
Reply With Quote
  #13 (permalink)  
Old Aug 10th, 2007, 15:19
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Quote:
Originally Posted by Lchad View Post
Here's some code for ya... it's similar to Justin's but I do it a bit differently. See if either of these shed light on your situation.
I was trying this solution but can't get the middle image to appear. I'm testing it at http://wickedmoon.com/wickedmoon_v2c.php. The style sheet is at http://wickedmoon.com/styletest.css.
Reply With Quote
  #14 (permalink)  
Old Aug 10th, 2007, 17:14
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

oops.. I think the url for the background image is incorrect
Code: Select all
#wrapper {
    width: 995px;
    margin: 0 auto;
    background-image:url(gfx/layout2007summer/scroll_middle.jpg) repeat-y;
    }
Check the path to this graphic called scroll_middle.jpg (the part in red) Is that the path to your image on your computer?
also change background-image to background...

try:
Code: Select all
#wrapper {
    width: 995px;
    margin: 0 auto;
    background:url(gfx/layout2007summer/scroll_middle.jpg) repeat-y;
    }
Reply With Quote
  #15 (permalink)  
Old Aug 10th, 2007, 17:56
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

That works in IE6, but not FF2 (I didn't try it in IE before the changes we just made, so I don't know if it was working before or not). I tried emptying the browser cache. The image URL is correct. Any ideas what FF needs to display this image?
Reply With Quote
  #16 (permalink)  
Old Aug 10th, 2007, 18:02
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Do you have any words in the middle div? If not, you probably won't see the background in FF. Put some fake content in.
Reply With Quote
  #17 (permalink)  
Old Aug 10th, 2007, 19:28
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Yes, there was some text in. I've just put an image in, but there's still no background image. http://wickedmoon.com/wickedmoon_v2c.php. It looks like it might not be possible with CSS?
Reply With Quote
  #18 (permalink)  
Old Aug 10th, 2007, 19:38
Junior Member
Join Date: Jul 2007
Location: Dallas, TX
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Yes it is possible...but you need to know your directory structure if you are going to build a website.

If you have a root folder with page.htm in it...and your CSS is in includes within the root...and your images are ALSO in the root...then the images and the CSS are at the same directory level.

When the page is rendered, the images are called in relation to the CSS, not the html file.

In your case you have your image in a subfolder one level deeper in your directory than the CSS is, which is probably why FOrefox is not finding it.

Try this
Code: Select all
background:url(/gfx/layout2007summer/scroll_middle.jpg)
the forward slash is saying go to the root of the site...then to folder gfx, etc. to find the image
Reply With Quote
  #19 (permalink)  
Old Aug 10th, 2007, 19:50
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

Still not working. Earlier I had tried an absolute URL also. If this is going to work, there must be some small change to make.
Reply With Quote
  #20 (permalink)  
Old Aug 10th, 2007, 19:55
Junior Member
Join Date: Aug 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Struggling to convert tables to CSS

I tried it with just background:url(scroll_middle.jpg) repeat-y; too, with the image in the root directory.
Reply With Quote
Reply

Tags
graphic, table, tile

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Struggling to find a decent Popup Script christopher JavaScript Forum 4 Apr 6th, 2008 20:22
i am REALLY struggling DPhahn Other Programming Languages 39 Feb 21st, 2008 13:45
Struggling with Keywords Pickle Search Engine Optimization (SEO) 4 Jul 3rd, 2007 22:14
Creating Forum - Struggling with Text Box Size minckle ASP.NET Forum 2 Apr 18th, 2007 13:45
Easiest way to convert from tables to CSS aod2002 Web Page Design 17 Mar 11th, 2007 01:33


All times are GMT. The time now is 09:07.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43