HTML - Align The Columns Of All The Nested Tables
I have some nested tables (collapse/expand kinda table). How can I align the columns of each nested table, if all are expanded I want to see all the columns underneath symetrical.
I have attached the screenshot of what I am getting with the following code: HTML Code: <head runat="server"> <title>Untitled Page</title> <style type="text/css"> .collapsed { display: none; } table#container { background-color:#FFFFFF; border: solid #000 3px; width: 400px; } table#container td { border: solid #000 1px; } table#sub { background-color:#FFFFFF; border: solid #000 0px; width: 400px; } table#sub td { border: solid #000 1px; } .toprow { font-style: italic; text-align: center; background-color: #FFFFCC; } .leftcol { font-weight: bold; text-align: left; width: 1%; background-color: #CCCCCC; } </style> <script language="javascript" type="text/javascript"> //***collapsible rows function outliner(evt) { evt = (evt) ? evt : (window.event) ? window.event : ""; var oMe; if (evt.srcElement) { oMe = evt.srcElement; } else if (evt.target) { oMe = evt.target; } if (evt.srcElement) { //for IE var child = document.all[oMe.getAttribute("child",false)]; } else { //for Firefox var child = document.all[oMe.getAttribute("child",false)]; } //get child element //if child element exists, expand or collapse it. if (null != child) child.className = child.className == "collapsed" ? "expanded" : "collapsed"; } function changepic(evt) { evt = (evt) ? evt : (window.event) ? window.event : ""; var uMe; if (evt.srcElement) { uMe = evt.srcElement; } else if (evt.target) { uMe = evt.target; } var check = uMe.src.toLowerCase(); if (check.lastIndexOf("expand.gif") != -1) { uMe.src = "images/collapse.gif"; } else { uMe.src = "images/expand.gif"; } } </script> </head> <body onclick="outliner(event)"> <table id="container" border="1"> <thead> <tr class="toprow"> <td /> <td>Parameter</td> <td>Value</td> <td>DataType</td> </tr> </thead> <tr> <td class="leftcol"> </td> <td>name</td> <td>Mark</td> <td>String</td> </tr> <tr> <td class="leftcol"> <a><img border="0" alt="expand/collapse" class="expandable" height="11" onclick="changepic(event)" src="images/expand.gif" width="9" child="s2" p21="p21" p22="p22" p22="p23"></a> </td> <td>composite</td> <td>100,200,red</td> <td>CompositeType</td> </tr> <tr> <td colspan="4" bgcolor="cyan" class="collapsed" id="s2"> <table id="sub"> <tr> <td> </td> <td>X</td> <td>100</td> <td>Int32</td> </tr> <tr> <td> </td> <td>Y</td> <td>200</td> <td>Int32</td> </tr> <tr> <td class="leftcol"> <a><img border="0" alt="expand/collapse" class="expandable" height="11" onclick="changepic(event)" src="images/expand.gif" width="9" child="s3"></a> </td> <td>color</td> <td>134,122,234</td> <td>Color</td> </tr> <tr> <td colspan="4" bgcolor="cyan" class="collapsed" id="s3"> <table id="sub"> <tr> <td> </td> <td>R</td> <td>134</td> <td>Int32</td> </tr> <tr> <td> </td> <td>G</td> <td>122</td> <td>Int32</td> </tr> <tr> <td> </td> <td>B</td> <td>234</td> <td>Int32</td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> Similar TutorialsHi there, I have a question, in my photo gallery I have three columns: http://leilanimunter.com/photogallery.htm On a PC, the columns are aligned at the top in Firefox, but look all messed up in IE. On my Apple, it looks fine in Safari but they are not aligned properly in Firefox. I am just adding breaks at the bottom to move the other shorter columns up. Is there a code where I can vertically align these columns at the top so it will work on all browsers? Thanks for any help you can offer! Leilani Hi experts, I'm trying to create a form whereby I need to insert more than 100 radio buttons for user to select. When I tried out my code which is as follows:- <td>Locations</td> <td><input type="radio" id="txtlocation" value="Admiralty" name="txtlocation"/>Admiralty and the list go on until the 100 radio buttons. The outcome is horrendous to say the least. I hope the experts here can share with me how to neathly align all the radio buttons into 3 columns with 22 rows. OK. Hope to hear the experts' view soon. Thank you. Hi, I am using CSS with nested tables. There are two <td> fields in the innermost table, and are having links inside them. When I open the page in IE, and move the mouse over to the first cell, the whole cell becomes active. But the second cell becomes active only if I take the mouse on the text. Why this inconsistency? Can anyone help? Thanks. Please refer attached html and css files Hello, Can anybody help me out? I have a nested table as such: =========================================== <table cellspacing="0" cellpadding="3" border="1"> <tr> <td>Joe <table> <tr> <td>A </td> </tr> </table> </td> </tr> </table> =========================================== How can I get "Joe" and "A" on the same line without changing the table structure? (Can't change structure cuz this is how my server side code spits it out. But I can add styles and attributes.) I've tried all manner of floating, margins, padding, aligning, hspacing, vspacing, and nothing seems to work. Thanks for any help. Hello guys, I want to create a page with nested html tables. I have attached an image of exactly what I want. Can you please help me with that? hi everybody, i have a problem displaying an html page that contains nested tables, all in a div. now the testing page that i present is a simple html, which works just fine in FF, chrome, safari and opera. sadly, it doesnt in IE7 (didnt test other IE versions). the goal is to make the scroll of the div reflect the width of the tables. i dont know what is causing this, maybe there's something missing in my code, or just an IE bug, perhaps... Anyway, i appreciate you reading this and thanks for your help, if any. Hi I need help in tables with 100%. Actually i am keeping a table with 100% fihed width in a <td>, but when i am minimising the IE or Firefox browser the columns are reducing , how to solve the problem How can I make textbox in cell[2,2] get its right border displayed and aligned with upper cell??? <table style="padding-right: 20px" cellspacing="0" cellpadding="0" width="1000px"> <tr> <td width="25%"> <span id="Label9">label</span><br /> <input name="TextBox10" type="text" id="TextBox10" style="border-width:1px;border-style:solid;width:100%;" /> </td> <td width="25%"> <span id="Label10">label</span><br /> <input name="TextBox11" type="text" id="TextBox11" style="border-width:1px;border-style:solid;width:100%;" /> </td> <td width="25%"> <span id="Label11">label</span><br /> <input name="TextBox12" type="text" id="TextBox12" style="border-width:1px;border-style:solid;width:100%;" /> </td> <td width="25%"> <span id="Label12">label</span><br /> <input name="TextBox13" type="text" id="TextBox13" style="border-width:1px;border-style:solid;width:100%;" /> </td> </tr> <tr> <td> <table cellspacing="0" cellpadding="0" style="width: 100%"> <tr> <td style="padding-right: 15px" width="50%"> <span id="Label18" style="display:inline-block;width:100%;vertical-align: top; text-align: left">label</span><br /> <input name="TextBox19" type="text" id="TextBox19" style="border-width:1px;border-style:solid;width:100%;" /></td> <td align="right" width="50%" > <span id="Label19" style="display:inline-block;width:100%;vertical-align: top; text-align: left">label</span><br /> <input name="TextBox20" type="text" id="TextBox20" style="border-width:1px;border-style:solid;width:100%;" /></td> </tr> </table> </td> <td> <span id="Label20">label</span><br /> <input name="TextBox21" type="text" id="TextBox21" style="border-width:1px;border-style:solid;width:100%;" /> </td> <td colspan="2"> <span id="Label21">label</span><br /> <input name="TextBox22" type="text" id="TextBox22" style="border-width:1px;border-style:solid;width:100%;" /> </td> </tr> </table> Hey everyone, I have a music video website and on each genre page, I want to build a table to list each band along with a thumbnail image. I know how to do this, however, I can't figure out how to add a cell without completely throwing off the rest of the table. For example, if I alreay have a 3 column table with Aerosmith, Alice Cooper and Chris Isaak in those 3 cells in the first row but I want to add a Beck video (which would need to go between Alice Cooper and Chris Isaak alphabetically), it throws off the cells in that row and in all the other rows of the entire table. I thought about using 1 cell tables for each band but I can't get them to sit next to eachother, they will only stack one on top of the other. Can someone give me some advice or direction? Does that make sense? Hi there, I'm trying to pull a dynamically generated page into order and I'm struggling to work out how I can get these tables within a larger table to align to the top. Unfortunately I'm stuck with them and can't use Divs or something more sensible because the way it's generated, however I can use css etc. You'll see that the tables alter their vertical alignment based on the text in the box, I want it to align to the top by default and stretch the bottom as required. Code: <table style="width:500px;"> <tr> <td style="width:25%"><table valign="top" class="news_box"><tr><td class="newscategory_Tutorial"><img src="images/6.jpg"/></td></tr><tr><td>Tutorial | <span class="news_title">Ocean Waves</span></td></tr> <tr><td>A detailed tutorial on stuff!</td></tr></table></td><td style="width:25%"><table valign="top" class="news_box"><tr><td class="newscategory_Article"><img src="images/5.jpg"/></td></tr><tr><td>Article | <span class="news_title">Article number one</span></td></tr> <tr><td>Short text to describe the article itself goes here</td></tr></table></td><td style="width:25%"><table valign="top" class="news_box"> <tr><td valign="top" class="newscategory_News"><img src="images/1.jpg"/></td> </tr><tr><td valign="top">News | <span class="news_title">Boardroom Basics</span></td> </tr> <tr><td valign="top">subtitle text goes here</td> </tr></table></td><td style="width:25%"><table class="news_box" valign="top"> <tr><td valign="top" class="newscategory_Article"><img src="images/2.jpg"/></td> </tr><tr><td valign="top">Article | <span class="news_title">test3</span></td> </tr> <tr><td valign="top">nbdfn</td> </tr></table></td></tr></table> Hey Everyone, Can someone align these 3 tables for me. Code: <td class='maincontent' colspan='2'> <table class='maintable' cellpadding='0' cellspacing='0'> <tr> <td width='20%' valign='top' style='padding: 8px; padding-right: 0px;'> <?php include "columnmenus.php"; ?> </td> <td width='60%' valign='top'> <td width='20%' valign='top' style='padding: 8px; padding-right: 0px;'> <?php include "rightcolumnmenus.php"; ?> </td> Hello, just starting here I complete the HTML an CSS tutorials at http://www.w3schools.com/ I also downloaded a trial for coffeecup I am helping a local business with their website, it is very simple, just content and a couple of pictures. For some reason, as much as I google it up I cannot figure out how to add a left column to the site. the examples I find, even free templates from Amaya use tables. I dont want to use tables, I guess I need to use div? But if that is so, how do I position my column? It seems w3schools gave me a good start but I am having problems putting the concepts together. If you can direct me to the right answer, or recommend a book or tutorial that actually builds a simple site with a couple of columns in good design, I would really appreciate it. But I dont want to use tables as I learned it is not best practice Thank you! Hello, I would like to make my two column web page into 3 columns and dont know how to do this. It is a template and I cannot figure out where to put the <td>. My site is online and then I hope to delete this link if it is possible. Please no negative remarks as I am notlooking for visitors I just want help. please. ] Here is the code I want to put into the code but not sure where to put it to get the 3rd column. I hope someone will be kind enough to help . thanks. <td width="200"> <table width="100%" border="1" cellspacing="0" cellpadding="0"> <tr> <td width="200"> <p> <a href="index.html">Home</a> </p> </td> </tr> </table> you have 3 floating divs. "bottom" "top" and "middle". "top" is inside of "bottom" --> in this scenario, can "middle" div ever be above "bottom" div, but below "top" without being inside of "bottom" div? Code: <div id="bottom" style="position:absolute; top:100px; left:100px; width:200px; height:100px; z-index:1; background-color:#F00;"><h1>bottom</h1> <div id="top" style="position:absolute; top:100px; left:150px; width:200px; height:100px; z-index:3; background-color:#00F;"><h1>top</h1></div> </div> <div id="middle" style="position:absolute; top:150px; left:150px; width:200px; height:100px; z-index:2; background-color:#0F0;"><h1>middle</h1></div> Hi Normally, when you have more than one table in your code, the tables will be placed one under each other. Example: <table> ... </table> <table> ... </table> When you want the tables to be placed next to each other, you need to set the align attribute. Example: <table align="left"> ... </table> <table align="left"> ... </table> BUT: When you do it like in the 2nd example (tables next to each other), in Firefox, the tables will wrap to a new line if there is no more space. In Internet Explorer, the tables will not wrap. The result is a horizontal scrollbar or "hidden tables". Why this? How can I make the tables wrap also in Internet Explorer as it does in Firefox? Is it possible with a special CSS definition or with a special DIV/SPAN tag? Thanks for your help praiser Hey everyone, I'm new to these boards. Somewhat a newbie at web design, but I know basics. I'm looking to put 2 tables adjacent to each other inside another table. My problem is I can't get the tables to line up the way I want them to. I'll post a picture of how I want it to look, how it looks now and my code. How I want it to look: How it looks now: I want the tables to line up at the top and re-size according to each other so they're always aligned at the top. Code: coming in next 2 posts How hard can it be? I already posted a similair item like this on a dutch forum (for those who do not know: I am dutch) but that ended in no result. Imagine yourself the painting from I think it was Barnett "Who is afraid of red, yellow and blue. Or better... take the French flag ( http://www.e-s-e-a.com/FRENCH%20FLAG.png ) Now could you or anyone else write me the script that would give me three columns? The left column 15% The right column 15% The middle column 70% I read that giving the columns a width in percentages was better because of screensizes. No header. No footer. Just 3 columns. It has to be like the French flag all over your screen. Well you don't have to give the columns exactly the same colors but it would be nice. I've been playing about with columns, and it really bugs me when I cant get to do it correctly, I need to know how to make a three column page like this one- http://watchseries.eu/ I know there is a lot of float involved, and no matter how much I try, I cannot get the hang of it. I've also read the column tutorial on this forum with no help. Hello, I am new here and hope someone can help. I am creating a page where I need to have several nested lists. The 'numbering' is showing up correctly but the 'nested' lists are not indented. Can anyone take a look at the page and my source code and see if you can help me figure out what is wrong? go to http://www.prewrath.com/index2.html Thank you! bzig I am currently trying to create some nested lists to display the following... A...R...X B...S...Y C...T...Z (where the letters will eventually be replaced by words) and have made this work perfectly in chrome and firefox, however when I use Internet Explorer I get something resembling the following... A B...R C...S...X .....T...Y ..........Z I assume it's probably to do with the css, but please can someone help me with this problem, the html and css are shown below, thanks in advance for any help. HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <link rel=stylesheet href="links.css" type="text/css"> </head> <body> <div id="container"> <ul id="links-nav"> <li> <ul> <li><a href="#">A</a></li> <li><a href="#">B</a></li> <li><a href="#">C</a></li> </ul> </li> <li> <ul> <li><a href="#">R</a></li> <li><a href="#">S</a></li> <li><a href="#">T</a></li> </ul> </li> <li> <ul> <li><a href="#">X</a></li> <li><a href="#">Y</a></li> <li><a href="#">Z</a></li> </ul> </li> </ul> <div class="clear"></div> </div> </body> </html> CSS Code: #container{ width:960px; margin:0px auto; border: 1px solid #000; padding:20px 10px; height:auto; font-family: Arial, sans-serif; font-size:11px; } .clear { clear: both; height: 0; overflow: hidden; } a{ text-decoration:none; color:#555; } #links-nav li, li ul li{ list-style:none; } #links-nav{ display:inline; margin:0; padding:0; } #links-nav li ul{ float:left; padding:0; width:168px; padding: 0px 10px; } |