CSS - Trying To Get Table Lines To Line Up
Here is my html for my tables
Code: <div id="Content"> <p class='instructions'>Click a column header to sort the table.</p> <div spry:region="jdmba"> <div spry:state="loading" class="loading">Please wait while alumni data loads…</div> <table width="680px" class="spry" cellspacing="0"> <tr> <th scope="col" width="113px" class="sortable" spry:sort="last" id="last">Last Name</th> <th scope="col" width="106px" class="sortable" spry:sort="first" id="first">First Name</th> <th scope="col" width="257px" class="sortable" spry:sort="account" id="account">Company</th> <th scope="col" width="66px" class="sortable" spry:sort="state" id="state">State</th> <th scope="col" width="69px" class="sortable" spry:sort="hls_year" id="hls_year">JD</th> <th scope="col" width="69px" class="sortable" spry:sort="hbs_year" id="hbs_year">MBA</th> </tr> </table> <div class="Overload"> <table width="680px" class="spry" cellspacing="0"> <tr spry:repeat="jdmba" spry:setrow="jdmba" spry:odd="odd" spry:even="even" spry:hover="hover" > <td width="113px">{last}</td> <td width="106px">{first}</td> <td width="257px">{account}</td> <td width="66px">{state}</td> <td width="69px">{hls_year}</td> <td width="69px">{hbs_year}</td> </tr> </table> </div> </div>....... Here is my CSS Code: .Content { font: 14px/normal Georgia, "Times New Roman", Times, serif; text-align: justify; display: block; padding: 2em 3em 3em; } .Overload { height: 208px; overflow: auto; } .odd { background-color: #E8E8E8; } .even { background-color: #E8E8E8;} .hover { background-color: #FFC;} table.spry { font-family: Verdana; font-size: 12px; line-height:20px; cursor: pointer; } .instructions { font-family: Verdana; font-weight:bold; font-size: 12px; line-height:20px; cursor: pointer; margin-bottom:8px; } .loading { font-family: Verdana; font-weight:bold; font-size: 12px; line-height:20px; cursor: pointer; margin-top:0px; margin-bottom:8px; color:#900; } table.spry th {border-left: 1px solid #000000; border-bottom: 1px solid #000000; border-top: 1px solid #000000; font-family:Verdana; } table.spry td {border-left: 1px solid #000000; border-bottom: 1px solid #000000; font-family:Verdana; } table.spry th.sortable:hover { cursor: pointer; } table.spry th.sortable { text-align:left; color:#FFFFFF; background: #8F001C url(../SpryAssets/bg.gif) no-repeat 95% 6px; } table.spry th.ascending { background: #8F001C url(../SpryAssets/SpryMenuBarUpHover.gif) no-repeat 95% 8px; } table.spry th.descending { background: #8F001C url(../SpryAssets/SpryMenuBarDownHover.gif) no-repeat 95% 8px; } I guess I was under the impression if I made them all the same lengths and the table width the same that everything would then lineup just fine. The other thing is that on IE it is not lined up one way and on FF it's not lined up again, but it's different. I would like to upload some images to show my problem. How do I go about putting an image up for you to see what I'm talking about? When I try to insert an image it doesn't give me an option to upload an image from my machine. Thanks! Similar TutorialsI recently relaunched our web site and, trying to stay with the times, use CSS as much as possible for layout purposes. The one place I still use a table for layout is in the top navigation bar, which includes a search form. I would like to eliminate the table and use CSS for styling the top navigation bar, but am not sure how. I want the pages to hold up in IE 5.0+, Mozilla, Netscape 6+, Firefox and Safari and to be tolerable in Mac IE 5.x - a tall order but manageable I think. Can this be done? Am I stuck with a layout table here? Any help is appreciated. You can see an example web page at: http://www.cambridgema.gov/~CDD/ The HTML is in the attached file. Greetings, I am relatively new to CSS and am using background image bullets. Problem is, in the case of a two line link, the bullet aligns in between the two lines and I need it to align to the top line. Below is the CSS, and attached is a screenshot of the link to better illustrate my predicament. Thanks for any help! li { list-style-type: none; background: url(../images/bullet.gif) no-repeat left; padding: 0 0 0 10px; } Greetings, I have a class called "header" and I am trying to give it a touch of extra space between it and the next line. All of my headers are just a few words and thus on one line. I tried placing "line-height: 1.5em" in my "header" class and it shows up correctly in Dreamweaver but not in IE. My thought is, because it is only a single line, that class value does not kick in because there is no second line for that class. Is there a way to conrol this in CSS or am I going to have to resort to using a....gulp.....spacer? Thanks in advance! I've got two lines of text. Want the spacing the two lines to increase, so I set a line-height. When I do this, not only does it increase space between the two lines, it also increases spacing above the first line (and maybe below the second). How can I increase spacing between the two lines only, without increasing above and below? Thanks! I have finished my transparency box backgrounds.. and, thanks to some help here.. have them working in multiple browsers.. Now, I have received a call.. that one person sees "black lines" through the boxes on the transparent boxes on the attractions and info pages.. (user is using IE and 1024x768) -I cannot recreate this problem on any machine.. is there some little strange bug that causes this on certain browsers? http://www.tkwebbiz.com/Gina2 Thanks so much.. *again*.. *Smiles* Anyone knows of a method to cause a vertical line to come all the way down ? Currently it stops where the text stops. but i want it to go all the way to the buttom of the document regardless of the text. (right now i use box border on one side) Thanks! I had a webpage where there were rows with three boxes on, that all floated left. After the third there was a line break and then the next line also had three boxes, etc. The boxes all have the same width, but different heights (not dramatically different). I am now wanting to allow the number of boxes on the line to vary with the width of the browser window. By removing the break every three lines this would work if all the boxes were the same height. As they are not, the box that should go onto the next line down might go down and a bit to the left before being "stopped" by a taller box. I expected this behaviour, but I'm not sure how to go further and get around it. Thanks for any ideas, Thomas Thanks for taking the time to read my question. I am trying to make a new page layout. I have one main box on the left [float: left;], and 3 stacked smaller boxes on the right [float: right;] I would like 2 lines joining the box on the left to the center box on the right. I'm trying to do this with a container that only has top and bottom borders. I don't know how to get the horizontal lines centered vertically. Also, the page layout works great in FF but not in IE. Not really sure why. Any suggestions on how to do this? oh and the green and red colors are only for development so they stand out. Thanks, Brad HTML: Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="author" content="piercedjunkmail@hotmail.com"> <meta name="generator" content="AceHTML 5 Freeware"> <link href="TestLayoutCSS.css" rel="stylesheet" type="text/css" /> <title>Test Layout 1</title> </head> <body> <div id="HeaderContainer">hi</div> <div id="RightTopContainer">hi</div> <div id="PageTitle">This is the title of the page</div> <div id="MajorLeftMainContainer"> <div id="LeftMainContainer">hi</div> <div id="HorizontalLines"></div></div> <div id="RightCenterContainer">hi</div> <div id="RightBottomContainer">hi</div> </body> </html> CSS: Code: @charset "iso-8859-1"; body { font-family: Foo, times, serif; margin: 0px; background-color: #4F9FC5; } #HeaderContainer { height: 50px; width: 100%; /*border-color: green; border-style: solid; border-width: 2px;*/ } #MajorLeftMainContainer { /*border-top-color: #FFFFFF; border-left-color: #FFFFFF; border-bottom-color: #C0C0C0; border-right-color: #C0C0C0; border-style: solid; border-width: 5px;*/ float: left; margin-top: 90px; margin-left: 10px; width: 67%; height: 310px; background-color: green; } #LeftMainContainer { border-top-color: #FFFFFF; border-left-color: #FFFFFF; border-bottom-color: #C0C0C0; border-right-color: #C0C0C0; border-style: solid; border-width: 5px; float: left; /*margin-top: 90px; margin-left: 10px;*/ width: 80%; height: 300px; background-color: #EAEAEA; } #RightTopContainer { border-top-color: #FFFFFF; border-left-color: #FFFFFF; border-bottom-color: #C0C0C0; border-right-color: #C0C0C0; border-style: solid; border-width: 5px; float: right; margin-top: 30px; margin-right: 10px; width: 30%; height: 150px; background-color: #EAEAEA; } #RightCenterContainer { border-top-color: #FFFFFF; border-left-color: #FFFFFF; border-bottom-color: #C0C0C0; border-right-color: #C0C0C0; border-style: solid; border-width: 5px; float: right; margin-top: 50px; margin-right: 10px; width: 30%; height: 150px; background-color: #EAEAEA; } #RightBottomContainer { border-top-color: #FFFFFF; border-left-color: #FFFFFF; border-bottom-color: #C0C0C0; border-right-color: #C0C0C0; border-style: solid; border-width: 5px; float: right; margin-top: 50px; margin-right: 10px; width: 30%; height: 150px; background-color: #EAEAEA; } #PageTitle { font-size: 25px; font-family: arial, times, serif; /*border-color: green; border-style: solid; border-width: 2px;*/ width: 340px; height: 35px; margin-top: 40px; margin-left: 25px; color: black; font-variant: small-caps; } #HorizontalLines { border-top-size: 2px; border-top-color: red; border-top-style: solid; border-bottom-size: 2px; border-bottom-color: red; border-bottom-style: solid; float: left; width: 124px; height: 30px; vertical-align: middle; } Hi there, I would like to get some opinions on what would be the best way, or even a good way, to display a list of lines from a database, such as product descriptions (a link), prices (text) and buy now links. For example: Segate Hard Drive 250gb $150.00 Buy Now Maxtor Hard Drive 300gb $200.00 Buy Now etc I thought it would be best to have a <ul> with each line being an <li>. Further to this, I tried having each line as a <li> element, with each column (price, buy now etc) an <li> element, displayed inline. This actually worked well, but I had trouble doing an alternate background color thing, which I think was due to my funny css code. I gave each <li> a class selector, so that different formatting could be applied, and I had each <li> float:left; and a width, to give a column style display. Would a table be the best way to display the 3 (or more) columns? I've removed tables from the site layout, and can see how they would make sense for this, as it basically is tabular data, repeated over and over again. Or would having each line as a <p> with say each column having its own <label> possibly be best? Or some variation on of the 3, or something else all together? I realise everyone would have their preferred style and there is no 'best', 'right or wrong' way etc. I'm trying to find a way that I can work with, one that could be considered 'the norm', or 'best practise'. I haven't posted any code, but can if people need more of an idea of what I am trying to do. Cheers Scott I was wondering if anyone knows how to get a space between blocks in a list. If you have list that have more that one line in a block it looks better to have gaps greater than the leading to separate them. I can't figure how to accomplish this, does anyone have any ideas. I need some help. I am a relative beginner with CSS and have a problem that is eluding me. Specifically in the right-hand sidebar on this page (FriendsAcrossTheWater.org/blog), you will note that all the links are on separate lines by themselves. I do not want this behavior and I am not sure what is causing it nor what to do to correct it. Can you help? Thanks, Bob Ross I have a repeating background image, that is very much driving me crazy. There is a line when the image repeats. I cannot figure out what the problem is. Below is an example, the image in the box is slightly shorter which is where you see the line. (URL address blocked: See forum rules) Thanks for any help. When printing pages from this site http://www.sorensteensen.dk/kvl/ one or two lines disappear when the pages break. I have no idea why. Anyone knows about it? Soren Steensen [EDIT]COME ON GARY AND KRAVVITZ [/EDIT] First off, don't mind my usage of selectors. I will explain. Time to turn the tables and ask some help.. Never thought I would have to ask a CSS question (it's more logic then CSS anyway)but if you look at here you will see a sample quiz on Sitepoint (number 13) in which there are lines connecting the divs. I still have some work to do on the general layout, but all I need in that is more time. I can not edit the HTML in the body section, which is why I am using such selectors. Obviously I have to use borders to achieve this effect but I need a little guidance. Page in question is http://www.devwebsites.com/temp/ Code for the lazy is he Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Organisation Chart</title> <style type="text/css"> *{margin:0;padding:0;margin:0 auto;} body{ text-align:center; overflow-x:hidden; } h2{ font-size:12px; text-align:left; font-weight:normal; margin:15px 0 0 20px; } ul{ list-style-type:none; color: #000066; } ul li dl dt{ color: #000066; font-weight:bold; } dl{ width:200px; } body>dl{ width:150px; border: 1px solid #000066; margin-top:25px; background-color: #DDEEFF; padding:4px; } body>dl>dt{font-weight:bold;} body>ul+li{ border:1px solid #000066; position:relative; left:-22px; } body>ul+h2+ul>li>dl>dt{ background-color: #778899; width:200px; float:left; color:white; } dt.sub+dd>ul>li{ width:200px; border:1px solid #000066; background-color: #DDEEFF; } body>ul+h2+ul>li>dl>dt+dd{ background-color: #DDEEFF; } body>h1+dl+h2+ul>li{ border:1px solid #000066; text-align:left; width:120px; float:right; position:relative; right:30%; padding:6px; background-color: #DDEEFF; } body>h1+dl+h2+ul>li+li{ left:-47%; } body>ul+h2{clear:both;top:20px;position:relative;} body>ul+h2+ul>li{ float:left; } ul>li>dl>dt+dd{ text-align:left; } body>ul+h2+ul>li>dl{ border-right:25px solid white; position:relative; left:236px; top:25px; } </style> </head> <body> <h1>Organization</h1> <dl> <dt>President</dt> <dd>A. Andrews</dd> </dl> <h2>Support Staff</h2> <ul> <li> <dl> <dt>Vice President</dt> <dd>B. Burns</dd> </dl> </li> <li> <dl> <dt>Secretaries</dt> <dd>C. Colins</dd> <dd>D. Dylan</dd> </dl> </li> </ul> <h2>Divisions</h2> <ul> <li> <dl> <dt>Economy</dt> <dd> <dl> <dt>Manager</dt> <dd>E. Ericson</dd> <dt>Secretary</dt> <dd>F. Fitzgerald</dd> <dt>Employees</dt> <dd>25</dd> </dl> </dd> </dl> </li> <li> <dl> <dt>Marketing</dt> <dd> <dl> <dt>Manager</dt> <dd>G. Glockstettner</dd> <dt>Secretary</dt> <dd>H. Holmes</dd> <dt>Employees</dt> <dd>14</dd> </dl> </dd> </dl> </li> <li> <dl> <dt>Products</dt> <dd> <dl> <dt>Manager</dt> <dd>I. Irkwell</dd> <dt>Secretary</dt> <dd>J. Jones</dd> <dt>Employees</dt> <dd>89</dd> <dt class="sub">Subdivisions</dt> <dd> <ul> <li>Manufacturing</li> <li>Quality Assurance</li> </ul> </dd> </dl> </dd> </dl> </li> </ul> </body> </html> Ok, so I've finally made a design that I think looks OK, and the one last problem that I've come across is that IE(7) is adding some space at the edges of my divs, but it looks just how it should in Firefox: http://chipchamp.awardspace.com/webtemps Look at it in firefox and IE, and you'll see what I mean.. Here is the entire code for the page: Code: <html> <head> <style type="text/css"> body { background-image: url(images/design_5x1.gif); text-align:left; } div { border-width:0px; margin:0px; padding:0px; } #main-wrapper { background-color:transparent; width:800px; margin-top:50px; } #header { background-color:transparent; background-image:url(images/design_3x3.gif); width:800px; height:102px; } #content { background-color:#ffffff; width:100%; height:700px; } #menu { background-color:#ffffff; width:33%; float:left; } #content2 { background-color:#ffffff; width:60%; float:right; } #footer { background-color:transparent; background-image:url(images/design_7x2.gif); width:100%; } #footer-content { background-color:transparent; background-image:url(images/design_7x2.gif); width:680px; height:40px; } img.left { float:left; } img.right { float:right; } </style> </head> <body> <center> <div id="main-wrapper"><div id="header"><img class="left" src="images/design_3x2.gif"> </img><img class="right" src="images/design_3x6.gif"></img> <img class="right" src="images/design_3x5.gif"></img> <img class="right" src="images/design_3x4.gif"></img></div> <div id="content"><div id="menu"><img class="right" src="images/design_4x2.gif"></img></div> <div id="content2">hi again</div></div> <div id="footer"><img class="left" src="images/design_7x1.gif"></img> <img class="right" src="images/design_7x4.gif"></img><div id="footer-content">Copyright (c) 2008 ChipChamp Studios</div></div></div> </center> </body> </html> I have found out that if I comment out the background-image lines in #header and #footer, then the ugly white lines on the sides go away -- but so does some of the background image in the middle of the header/footer. So, does anyone have any idea how to fix this? It would be a great help! If you can fix the problem for either the header or the footer, I should be able to fix it for the other, so you don't have to fix both. Thanks! Am I commenting lines incorrectly? If I prefix a line with two slashes // in the CSS, firefox will ignore it. IE will recognize it and perform the CSS styling. For instance: Code: table.myTable tr td { background-color: red; //background-image: url('mypic.jpg'); } The TD element will not have a background in firefox. It WILL have the background image in IE. P.S. I am using IE8 on Win7 RC1 (build 7100). Thank you CSS Validator Two lines of CSS won't validate because they are used to fix a navigation issues in IE. Without those two lines there is a huge height gap between each list element in IE. Anyway I can hide these two lines from the validator? Hi, I am writing a code for form: Code: private name: <input size="10" name="private_name" type="text"> last name: <input size="10" name=last_name" type="text"> I want to increase the space between the two lines I tried to use the css line-height and it did increase the vertical space between the two lines. However only in the part of the words. In the case of the two input boxes instead of more space they become "taller", I can understand the logic behind this, what I don't know is a way to increase the vertical space between the two lines that will work in the case of the input boxes as well. How can I solve this? Thank in advance I'd like for these to align nice and neat, but when the lines break, they don't line up. See submenus: http://test.firstinsurancefunding.net/first-advantage/why-first/ Thanks in advance! Hi: After entering data into a database from a form (HTML) using php, I now have to retrieve the data, place it in a form style and print. Everything works fine when I do the print except for one thing. Description of Problem: When I print using IE 6.0, all vertical and horizontal lines which separate data from each other (cells) print. When I do the print in Mozilla, only the horizontal lines appear. How can I fix this, or, what makes it do this in Mozilla and not in IE? There is one thing I'm not doing, I'm not using CSS to format the form. Could this fix the problem? Any suggestions will be greatly appreciated! Thanks! |