HTML - Problem With Inconsistent Table Widths...screws Up Alignment.
Hi guys,
I have a problem with table widths used to arrange content on a website. Why am I not using DIVs? Because it's too time consuming at the moment to convert it over, and my client is not familiar with DIVs and has no time to learn it. So I have to stick to using tables for him to maintain on his own. Here's a quick rundown on my table layout. ----------------------------- |TD1-------------|TD1a****| ------------------ |TD2-------------|********| ------------------ |TD3-------------|********| ------------------ |TD4-------------|********| |Table 2----------|********| ------------------------------ |TD5-------------|********| ------------------------------ That's my attempt to illustrate my layout. I'm using * and - as fillers, the editor removes all the empty spaces... My problem is, TD1 to TD3 and TD5 aligns nicely vertically - they all have the same / correct width. However, TD4 with a table inside is slight shorter in width than it should. About 1 or 2 px. The following shows the screenshots. zoomed in.... I need to get that TD4 with the table inside to have the same width as the others. I have tried removing all BORDER and BORDERCOLOR codes from all the table tags, no use. I tried using both CSS and the table tag WIDTH to control it, still doesn't work. Need suggestions!! Please click here to see my code. It's a little messy... http://www.thienkaiwei.com/index7.html Similar TutorialsHello all, Just quick question: 1.) I am on Blogger and I want the layout to be centered (not the text). How can I achieve this? 2.) I have 4 containers (navigation at top, main for posts, sidebar for more navigation, and a footer), what is the best way to have a width that looks great/compatible on IE-FF as well as smaller CRT's to widescreen LCD's? 3.) Any other tips/suggestions/clean up on my coding would be much appreciated. Thanks in advance, I apologize if this is a bit much... Code: body { background:$bgcolor; background-image: url(); background-repeat: repeat; background-attachment: fixed; margin:0; color:$textcolor; font:x-small Georgia Serif; font-size/* */:/**/small; font-size: /**/small; text-align: center; } a:link { color:$linkcolor; text-decoration:none; } a:visited { color:$visitedlinkcolor; text-decoration:none; } a:hover { color:$titlecolor; text-decoration:underline; } a img { border-width:0; } /* Header ----------------------------------------------- */ #header-wrapper { margin:0 2% 10px; border:0px solid $bordercolor; width: 1072px; } #header-inner { background-position: center; margin-$startSide: auto; margin-$endSide: auto; } #header { margin: 5px; border: 0px solid $bordercolor; text-align: center; color:$pagetitlecolor; } #header h1 { margin:5px 5px 0; padding:15px 20px .25em; line-height:1.2em; text-transform:uppercase; letter-spacing:.2em; font: $pagetitlefont; } #header a { color:$pagetitlecolor; text-decoration:none; } #header a:hover { color:$pagetitlecolor; } #header .description { margin:0 5px 5px; padding:0 20px 15px; text-transform:uppercase; letter-spacing:.2em; line-height: 1.4em; font: $descriptionfont; color: $descriptioncolor; } #header img { margin-$startSide: auto; margin-$endSide: auto; } #newnavbar { position: absolute; width: 1072px; height: 50px; margin: 0 auto; margin-top: 0px; font-weight: normal; background: url("")no-repeat; } #newnavbar a{ color:#000000; } #newnavbar a:hover{ color:#ff9900; } /* Outer-Wrapper ----------------------------------------------- */ #outer-wrapper { position: absolute; margin: 0 auto; padding:10px; width: 1072px; text-align:$startSide; font: $bodyfont; } #wrap2 { width: 1072px; } #main-wrapper { background:#000000; margin: 0 auto; width: 672px; float: left; display: inline; /* fix for doubling margin in IE */ word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } #sidebar-wrapper { background:#000000; margin: 0 auto; width: 400px; float: right; display: inline; /* fix for doubling margin in IE */ word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } /* Headings ----------------------------------------------- */ h2 { margin:1.5em 0 .75em; font:$headerfont; line-height: 1.4em; text-transform:uppercase; letter-spacing:.2em; color:$sidebarcolor; } /* Posts ----------------------------------------------- */ h2.date-header { margin:1.5em 0 .5em; } .post { margin:.5em 0 1.5em; border-bottom:1px dotted $bordercolor; padding-bottom:1.5em; } .post h3 { margin:.25em 0 0; padding:0 0 4px; font-size:140%; font-weight:normal; line-height:1.4em; color:$titlecolor; } .post h3 a, .post h3 a:visited, .post h3 strong { display:block; text-decoration:none; color:$titlecolor; font-weight:normal; } .post h3 strong, .post h3 a:hover { color:$textcolor; } .post p { margin:0 0 .75em; line-height:1.6em; } .post-footer { margin: .75em 0; color:$sidebarcolor; text-transform:uppercase; letter-spacing:.1em; font: $postfooterfont; line-height: 1.4em; } .comment-link { margin-$startSide:.6em; } .post img { padding:4px; border:1px solid $bordercolor; } .post blockquote { margin:1em 20px; } .post blockquote p { margin:.75em 0; } /* Comments ----------------------------------------------- */ #comments h4 { margin:1em 0; font-weight: bold; line-height: 1.4em; text-transform:uppercase; letter-spacing:.2em; color: $sidebarcolor; } #comments-block { margin:1em 0 1.5em; line-height:1.6em; } #comments-block .comment-author { margin:.5em 0; } #comments-block .comment-body { margin:.25em 0 0; } #comments-block .comment-footer { margin:-.25em 0 2em; line-height: 1.4em; text-transform:uppercase; letter-spacing:.1em; } #comments-block .comment-body p { margin:0 0 .75em; } .deleted-comment { font-style:italic; color:gray; } .feed-links { clear: both; line-height: 2.5em; } #blog-pager-newer-link { float: $startSide; } #blog-pager-older-link { float: $endSide; } #blog-pager { text-align: center; } /* Sidebar Content ----------------------------------------------- */ .sidebar { color: $sidebartextcolor; line-height: 1.5em; } .sidebar ul { list-style:none; margin:0 0 0; padding:0 0 0; } .sidebar li { margin:0; padding-top:0; padding-$endSide:0; padding-bottom:.25em; padding-$startSide:15px; text-indent:-15px; line-height:1.5em; } .sidebar .widget, .main .widget { border-bottom:1px dotted $bordercolor; margin:0 0 1.5em; padding:0 0 1.5em; } .main .Blog { border-bottom-width: 0; } /* Profile ----------------------------------------------- */ .profile-img { float: $startSide; margin-top: 0; margin-$endSide: 5px; margin-bottom: 5px; margin-$startSide: 0; padding: 4px; border: 1px solid $bordercolor; } .profile-data { margin:0; text-transform:uppercase; letter-spacing:.1em; font: $postfooterfont; color: $sidebarcolor; font-weight: bold; line-height: 1.6em; } .profile-datablock { margin:.5em 0 .5em; } .profile-textblock { margin: 0.5em 0; line-height: 1.6em; } .profile-link { font: $postfooterfont; text-transform: uppercase; letter-spacing: .1em; } /* Footer ----------------------------------------------- */ #footer { width: 1072px; clear:both; margin:0 auto; padding-top:15px; line-height: 1.6em; text-transform:uppercase; letter-spacing:.1em; text-align: center; } #rec{ width: 400px; height: 35px; background: url("")no-repeat; } #cat{ width: 400px; height: 30px; background: url("")no-repeat; } #aut{ width: 400px; height: 35px; background: url("")no-repeat; } #new{ width: 400px; height: 35px; background: url("")no-repeat; } #bar{ width: 400px; height: 22px; background: url("")no-repeat; } /** Page structure tweaks for layout editor wireframe */ } body#layout #header { margin-$startSide: 0px; margin-$endSide: 0px; } ]]></b:skin> </head> <body> <div id='outer-wrapper'><div id='wrap2'> <!-- skip links for text browsers --> <span id='skiplinks' style='display:none;'> <a href='#main'>skip to main </a> | <a href='#sidebar'>skip to sidebar</a> </span> <div id='header-wrapper'> <b:section class='header' id='header' maxwidgets='5' showaddelement='yes'> <b:widget id='Header1' locked='true' title=' (Header)' type='Header'/> <b:widget id='HTML6' locked='false' title='Navigation' type='HTML'/> </b:section> </div> <div id='content-wrapper'> <div id='crosscol-wrapper' style='text-align:center'> <b:section class='crosscol' id='crosscol' showaddelement='yes'/> </div> <div id='sidebar-wrapper'> <b:section class='sidebar' id='sidebar' preferred='yes'> <b:widget id='HTML2' locked='false' title='WELCOME' type='HTML'/> <b:widget id='HTML3' locked='false' title='MEMBERS' type='HTML'/> </b:section> </div> <div id='main-wrapper'> <b:section class='main' id='main' showaddelement='yes'> <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/> </b:section> </div> <!-- spacer for skins that want sidebar and main to be the same height--> <div class='clear'> </div> </div> <!-- end content-wrapper --> <div id='footer-wrapper'> <b:section class='footer' id='footer'> <b:widget id='HTML1' locked='false' title='Content' type='HTML'/> </b:section> </div> </div></div> <!-- end outer-wrapper --> </body> </html> Hi all, my first post... I'm having troubles when i try to add a table after a left aligned table. When i add the second table it goes just at right of the previous table, not at bottom as i want. Example: HTML Code: <table width="60%" border="1" align="left" > <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> <table width="60%" border="1"> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> Any sugestions about placing the second table at bottom of first one are welcome. So, I'm having trouble getting a table to align over a background in IE. It looks fine in every other browser as you can see he But this is what it looks like in IE, about 1 pixel over: You can view the site at: http://www.ringaroundwithrosie.com/aboutrosie2.html and the CSS here. Does anyone see anything that could explain why it is not aligned properly in IE? Thanks for your help! Goodday, This is a bit of a follow-up on my previous question, but in some ways, it's also a seperate problem: Have a look at this. In the first table, the height is determined by 'height="200"' and the position of the 'Text' is 24 pixels above the bottom, exactly what I wanted. But now in the second table: Here the height is determined by the content of the first row and the 'Text' part's height is way to big. What happened? Why isn't it showing a table with the height I have set? What should I do to tell a cell it's height, starting from the bottom of the table? Thank you for your help, Laurens, Hi am trying to get multiple tables with different number of columns to be aligned properly. I'd expect the columns width the same width of both tables to be align properly. But they are not, as you can see on the attached picture at the bottom of the page. The first two columns look good, but the more columns I add the more shrewd up the result gets. Does anybody know how to get them properly aligned ? Of course it works if the width is given in px not in %, but that is not what I want to do. Using a single table and colspan is also not an option, as this is a simplified example of the problem. Thanx in advance. HTML Code: <html> <body> <style type="text/css"> .width100pro { width: 100%; } .c1-6 { width: 15%; } .c1-12 { width: 5%; } .t1 { width: 35%; } .t2 { width: 65%; } .b25 { width: 25px; } .b100 { width: 100px; } </style> <table class="width100pro"> <tr> <td class="c1-12"><input value="TestSMall" class="b25"></td> <td class="c1-6"><input value="TestBig" class="b100"></td> <td class="c1-12"><input value="TestSMall" class="b25"></td> <td class="c1-6"><input value="TestBig" class="b100"></td> <td class="c1-12"><input value="TestSMall" class="b25"></td> <td class="c1-6"><input value="TestBig" class="b100"></td> <td class="c1-12"><input value="TestSMall" class="b25"></td> <td><input value="TestBig" class="b100"></td> </tr> </table> <table class="width100pro"> <tr> <td class="c1-12"><input value="TestSMall" class="b25"></td> <td class="c1-6"><input value="TestBig" class="b100"></td> <td class="c1-12"><input value="TestSMall" class="b25"></td> <td class="c1-6"><input value="TestBig" class="b100"></td> <td class="c1-12"><input value="TestSMall" class="b25"></td> <td><input value="TestBig" class="b100"></td> </tr> </table> </body> </html> Hello everyone. Im new to forums and am looking for some help my my html. I am having problems with the alignment of my tables. They used to align perfectly but are now being stretched the length of the page. It has to do with my TD somewhere but I can't find it. If you check this code you'll see what I mean. Im not sure what I did but it never had this problem before. Let me know what you guys think. Thanks Hi Guys, I'm having major problems with setting the widths of columns on my page. As per attached pic, I'm trying to get the three main columns to be exactly 300 however it is putting it as 300 (308) in the design view which means the backgrounds in some of the table cells are repeating as shown in box and the text is spreading across the table cell width of what the figure is in brackets and not the 300 I want it to be. Any one got any ideas - its driving me nuts ! Why the "R w50" text is not on the right?? And why the widths on the top table are not correct? How can I fix it? Code: <table border=1 cellpadding=5 cellspacing=0> <tr> <td style=\"width:30px;\">w30</td> <td>n</td> <td style=\"text-align:right; width:50px;\">R w50</td> </tr> <tr> <td colspan=3> <table border=1 cellpadding=5 cellspacing=0 bordercolor=red width=100%> <td style=\"width:30px;\">w30</td> <td>n n n n n n n n n n n n n n n n n n n</td> <td style=\"text-align:right; width:50px;\">R w50</td> </table> </td> </tr> </table> Hi all, thank you in advance to anyone that can help. I'm sure this is probably an issue that has been covered in the past however I have had no luck finding it. I have a 2 column table with an iframe the left column. Firefox shows this correctly, the edge of the cell meets with the iframe etc, but when viewed in IE, the table widths change dramatically. I have inserted two images (firefox v IE) to show what is happening. If anyone can find what I have done wrong, I would greatly appreciated. Please, keep the replies in simple terms, I'm a bit of a n00b... As you can see, the gray table background has overlapped over the iframe. Hi all, thank you in advance to anyone that can help. I'm sure this is probably an issue that has been covered in the past however I have had no luck finding it. I have a 2 column table with an iframe the left column. Firefox shows this correctly, the edge of the cell meets with the iframe etc, but when viewed in IE, the table widths change dramatically. I have inserted two images (firefox v IE) to show what is happening. If anyone can find what I have done wrong, I would greatly appreciated. Please, keep the replies in simple terms, I'm a bit of a n00b... [IMG][img=http://img2.freeimagehosting.net/uploads/36b3e47e84.jpg][/IMG] Is it possible to set a table's width as something like this? HTML Code: <table width="100%-100px"> why the table i have dont expand over browser borders when sum of td widths is bigger than screen width? How can i overcome this problem? Hey guys, I want a kind of horizontal border down the side of my comment div, and padding that pushes it away from it. So far, it's worked perfectly in Firefox and Opera, but it goes all haywire in IE. I honestly don't even know what's going on. Here's an example page with the comments: http://automata.firephoenixnet.com/item/85 It looks okay in Firefox, but it looks all weird in IE. Can someone tell me what's causing this? Hi Guys, When the site is loaded in Internet Explorer when the window is not maximised upon maximising the window certain elements are no longer in the correct place, its like they stay where they loaded. I can only think that it would have something to do with the CSS Background Positioning on some div's. Any incite to what might be wrong would be appreciated. Cheers -Matt I have made a box mostly from 3 divs a top middle and bottom, when I add any h1 element makes a gap between the top and the middle killing the box effect in FireFox. I have tried everything with this but now give up, does anyone have any ideas on how to fix this. I have added a another div called maincontentinner so that the text was easier to adjust but even removing this did not solve it. All I am trying to do is get rid of the tables layout and have hit a brickwall my html HTML Code: <div class="mainboxtop"></div> <div class="maincontent"> <div class="maincontentinner"><!--All content starts here--> <h1> More Information</h1> this is a test </div><!--All content stops here--> <div class="mainboxbottom"></div> </div><!-- /closing of maincontentdiv --> the CSS Code: .maincontent { background:#CFCFCF url(../images/contentmain.gif) repeat scroll 0%; border:0; width:710px; } .maincontentinner {/*added to give padding inside the box and a few other styles*/ padding-left:15px; padding-right:15px; font-size:1.2em; } .mainboxtop { background:#CFCFCF url(../images/contenttop.gif) no-repeat scroll 0%; border:0; height:26px; margin:0; padding:0; width:710px; } .mainboxbottom { background:#CFCFCF url(../images/contentbottom.gif) no-repeat scroll 0%; border:0; height:26px; width:710px; } Here's a test page to see it for real Hello Experts, I am trying to display the attached table in my page. the problem I am facing is alignment of column values as Right justified. As you can see in the snap shot, The numbers inside the column arent aligned perfectly... If it possible to align the numbers and right justified (Not talking about right aligned with in the cell.) Hi I need help aligning a table with graphics heres the code I have now Quote: <!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>Milkshake NYC | Home</title> </head> <body> <table width="820" border="0"> <tr> <td width="612"><img src="http://milkshakekicks.com/shoes/freshness_banner.png" border="1" /></td> <td width="197"><img src="http://milkshakekicks.com/shoes/fannyad.png" hspace="5" border="1" /></td> </tr> <tr> <td><img src="http://milkshakekicks.com/shoes/newkicks.png" border="1" /> <img src="http://milkshakekicks.com/shoes/newlook.png" border="1" /></td> <td><img src="http://milkshakekicks.com/shoes/contestad.png" hspace="5" border="1" /></td> </tr> </table> </body> </html> But I need the spacing between graphics to be a little more "intelligent" I would like equal space between all the elements, I tried messing around using horizontal and vertical spacing tool in dreamweaver but didn't get very far. Any help is appreciated I have tried everything I can think of. I am working on a site. For now it is on freewebs. This is the page I am working on "http://www.freewebs.com/expeditiousracing/intro.html". I am trying to get the copyright table to the bottom of the page. I know how to align tables, it's just not working. I aligned the one on the top and the one on the left. I don't understand why it won't align to the bottom. Please help. This works in FF but in IE7 the last table is aligned to the left of the next table instead of underneath it? HTML Code: ' <table width="800" border="0"> <tr> <td width="400" align="center" class="style4"> <p> </p> <p class="style3">How can we help? </p></td> <td width="400" align="center" class="style4"> <p> </p> <p class="style3"> Services </p> </td> </tr> </table> <hr color="#000000" /> <table align="left" cellpadding="0"width="400" border="0"> <tr> <td height="472" background="leftservbg.gif"><blockquote> <p align="left"> </p> <p align ="left" fo>Granny's Helping Hands provides competent relief for care givers. We can also help with children and new mothers with baby care. Before we assign a Nureses Aide to you, a representative from our office may visit you to develop a plan of care. This assessment helps us choose the best companion or aide to meet your needs. </p> <p align="left">We offer a variety of billing options to our clients. Most insurances are welcome. We are also a contracted participant of the local Area Agency for the Aging's Waiver and Options programs. In addition we are proud participants of Commcare, OBRA, and Independence Waivers. Our services are avialble from 1 1/2 to 24 hours a day, 7 days a week.</p> <p align="left"> </p> <p align="left"> </p> </td> </tr> </table> <table align="left" cellpadding=""width="400" border="0"> <tr> <td width ="95"></td> <td width="190" height="236" valign="top" background="rgtservbg.gif" > <p class="space"> </p> <p align="center"><strong> Personal Care</strong></p> <blockquote> <p align="left" >Granny's Helping Hands provides competent relief for care givers</p></td> <td width ="95"></td> </tr> </table> <table align="left" cellpadding=""width="400" border="0"> <tr > <td background="rgtservbg.gif" height="236" width="190" > <p> </p> <p>Granny's Helping Hands provides competent relief for care givers</p></td> <td background="rgtservbg.gif" width="190" > <p> </p> <p>Granny's Helping Hands provides competent relief for care givers</p></td> </tr> </table> http://pastebin.com/4wByQNZQ How would i get the Ref. number 7.2 aligned with Nuclear Customer Quality Assurance... Also, under the human resources tables, The alignment under Ref. is not aligning properly with Hiring Process. What is the procedure here? Thanks, Rukus |