Skip navigation
Currently Being Moderated

Should i put my table in my external style sheet?

Apr 5, 2012 2:20 PM

Tags: #cs5 #adobe #div #html #dreamweaver #javascript #images #css #table #code #style #external #sheet #width

Should i put my table in my external style sheet? if so how do i do this?

i'm having serious problems trying to stop my menu bar and header to stop jumping around when a switch pages. I realised i needed to create an external style sheet. however, when i extracted the ccs styles from my one of my pages (my homepage), there is only styles for my spry menu bar, nothing else. - however this doesnt stop my menu bar from moving around. all of my pages are use tables. so my menu bar and header are both 'td' rather than in a div or wrapper.

it seems as though nothing i try will stop my items from moving around. they are all exactly the same width and height in html and the same in css. I know about attaching style sheets, but i just cant seem to understand how to get everything aligned properly. I want my external style sheet to have my header at the top and centre, and my menu bar underneath and centre. How do i do this using a table? do i put the table into the external style sheet so that my table measurements etc are the same for each page? + how do i do this? Does anything else other than positions, colours, fonts etc go into my external style sheet? cos im aware that i use the html for the things i want to look different and every page, and the css for the things that i want to look the same. so which stuff goes in which? im getting really confused now, does my header and menu bar need to go in my external style as well as my html? :S

 

everything just seems to have gone horribly wrong, ive tried so many things, but everything i try simply has no effect. blahhh :/

 
Replies
  • Currently Being Moderated
    Apr 5, 2012 2:26 PM   in reply to hannahmeow

    Table = HTML code.  You can't put HTML into your external style sheet.

     

    If you mean, "should I put my table styles into my external CSS?"  Sure. 

     

    Let's see a link to your page please.

     

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

    http://twitter.com/altweb

    http://alt-web.blogspot.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 2:32 PM   in reply to hannahmeow

    Feel free to post the code but you'll usually get much better answers if you upload your page to the web somewhere (a temporary location will do) so we can view it in our browsers and see the behaviour you're describing.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 3:10 PM   in reply to hannahmeow

    I would like to suggest you get away from tables for layouts.  You don't need them. 

    Tables are for spreadsheets and tabular data only.

     

     

    Copy & paste this into a new, blank html document:

     

     

    <!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=utf-8" />
    <title>Untitled Document</title>
    
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    
    <link href="ccs main.css" rel="stylesheet" type="text/css" />
    
    </head>
    
    <style type="text/css">
    /**add scrollbar channel**/
    html {overflow-y:scroll}
    
    body {background: #666;}
    
    #wrapper {
    width: 1064px;
    background:#FFF;
    margin: 0 auto; /**centered on screen**/
    }
    
    #footer {
    font-size: 12px;
    padding: 12px;
    border-top: 25px solid #999;
    }
    </style>
    
    <body>
    <div id="wrapper">
    <img src="product and website photos/header.png" width="1064" height="116" alt="header" />
    
    <!--begin menu -->
    <ul id="MenuBar1" class="MenuBarHorizontal">
    <li><a href="#home.html">Home</a></li>
    <li><a href="#" class="MenuBarItemSubmenu">Boutique</a><ul>
    <li><a href="#" class="MenuBarItemSubmenu">Women</a><ul>
    <li><a href="bwt.html">Tops</a></li>
    <li><a href="bws.html">Skirts/Shorts</a></li>
    <li><a href="bwl.html">Trousers/Leggings</a></li>
    <li><a href="bwa.html">Accessories</a></li>
    <li><a href="bwd.html">Dresses</a></li></ul></li>
    <li><a href="#" class="MenuBarItemSubmenu">Men</a><ul>
    <li><a href="#">Tops</a></li>
    <li><a href="#">Bottoms</a></li>
    <li><a href="#">Accessories</a></li></ul></li>
    </ul>
    </li>
    <li><a class="MenuBarItemSubmenu" href="#">T-shirt Shop</a><ul>
    <li><a href="t-shirt shop.html">Men</a></li>
    <li><a href="t-shirt shop.html">Women</a></li></ul></li>
    <li><a href="clearance.html">Clearance</a></li>
    <li><a href="#">About</a></li>
    </ul>
    
    <img src="product and website photos/dreadmadeby.png" alt="DREADAD" width="1064" height="561" />
    
    <div id="footer">
    <p>&copy; 2012 your footer text goes here
    </p> <!--end footer --></div>
    
    <!--end wrapper --></div>
    <script type="text/javascript">
    
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    
    </script>
    </body>
    </html>

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

    http://twitter.com/altweb

    http://alt-web.blogspot.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 4:04 PM   in reply to hannahmeow

    Remove the body CSS styles from your SpryMenubarHorizontal.css file (top and bottom of page).  Best to keep the menu styles separate from your main layout styles.

     

    Delete link to css main.css from your HTML code.

    It's a bad idea to add spaces to file and folder names.  Use single tokens or _ or - in between words but no spaces.

     

    Create a new CSS file.   File > New > Basic Page > CSS

    Cut & Paste the embedded CSS rules from the page I gave you into your new CSS file and SaveAs main.css.

     

    Link your HTML page to main.css in the usual way.

    http://alt-web.com/DEMOS/DW-Link-Stylesheet.shtml

     

     

    Nancy O.

     


     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points