HTML - Cell Width Problem In Ie.
Hi there.
I am working on this site. There is a problem with a table column spacing though... if this is what it looks like in Firefox (the way its supposed to be...) and this is what happened to it in IE. (dear lord...) the left menu and the content on the right are two adjacent cells of a table. how do i fix this ? it seems ie is giving equal width to both the cells. which explains the gap. i've tried using: Code: <td width=180> and also: Code: <colgroup span="2"> <col width="180"></col> <col width="500"></col> </colgroup> but none of them work. please help me out.. the page is available at > http://ramniquesingh.googlepages.com/index.html the .css file is available at > http://ramniquesingh.googlepages.com/default_style.css thanks. Similar TutorialsI have a very simple table that I cannot simply get to render correctly across IE, Firefox, and Opera. At first, I was using CSS to define the cell widths/heights - when that was giving me issues I got rid of all the CSS and attempted to use plain HTML. The problem persisted. Here's the code - it doesn't get much simpler than this: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> <table cellspacing="0" cellpadding="0" border="1"> <tr> <td width="15" height="33">a</td> <td>b</td> <td>c</td> <td width="15" height="33">d</td> </tr> <tr> <td colspan="4" rowspan="1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</td> </tr> </table> </BODY> </HTML> Appearance in Opera Appearance in IE7 Appearance in Firefox (this is what I want it to look like in all browsers) I haven't done HTML seriously in 7-8 years or so but I don't really remember having these problems with IE/Netscape. The fix I found for IE was to use style="table-layout: fixed" for the table: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> <table cellspacing="0" cellpadding="0" border="1" style="table-layout: fixed"> <tr> <td width="15" height="33">a</td> <td>b</td> <td>c</td> <td width="15" height="33">d</td> </tr> <tr> <td colspan="4" rowspan="1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</td> </tr> </table> </BODY> </HTML> Now IE works fine, Firefox didn't break, but Opera's cells still are not 15 pixels. IE7 Appearance fixed Here's my attempt at getting Opera to display it properly by mixing CSS and HTML: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> <table cellspacing="0" cellpadding="0" border="1" style="table-layout: fixed"> <tr> <td style="width: 15px; height: 33px" width="15" height="33">a</td> <td style="height: 33px">b</td> <td style="height: 33px">c</td> <td style="width: 15px; height: 33px" width="15" height="33">d</td> </tr> <tr> <td style="width: 100%" width="100%" colspan="4" rowspan="1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</td> </tr> </table> </BODY> </HTML> Opera looks even worse now This seems like such a simple table. I really don't understand why I'm having such a hard time. I believe the second row - using colspan is causing the issue. Please don't answer with - "dont use tables" or something silly like that Thank you -TableTrTd Hi everyone: Any help appreciated. Objective: To have three equally sized and spaced images arranged horizontally, with their size set automatically by the size of the window. Development: I'm using a Mac, and I don't have ready access to a PC to experiment. What I tried: Code: <table> <tr> <td><img src = "a.png" style = "width: 100%" /></td> <td><img src = "b.png" style = "width: 100%" /></td> <td><img src = "c.png" style = "width: 100%" /></td> </tr> </table> <p class = "caption">A caption for the 3 images</p> <p class = "legend" >A legend for the three images</p> What happened: This works perfectly in Safari and Firefox (Mac) and Firefox under Vista, but in Internet Explorer under Vista , the images are HUGE - the unscaled size of the originals. What I think is the reason: IE is taking 100% to be relative to the width of the body element, not the td element. What I don't want to have to do: Use fixed sizes or calculate the sizes on the fly. What I'm trying now: removing the table and using a div, and inside that, setting the image width to 33% and floating one right and one left. What's the trick to get around this IE "gotcha" please? Thanks from a newbie. Hello all! I wanted to ask if there is a way to specify certain width sizes for table cells in a table. The thing is that I have a table in one webpage that, if I leave the width of the TD cells unspecified, I usually end up with some cells being very wide because the text that is written inside them is very big and does not roll up automatically and other cells shrink and become very small in order for the total table not to lose its specified length. Can I set a specific width for the cell that gets filled with many words so that the contents of this cell will wrap and not extend so much? Thank you! Does anyone have an idea how I can make the text in the TD-tags fit 100% in its cell. Help would be highly appreciated. Quote: <html> <style> .text {text-transform: uppercase; } </style> <body> <center> <table width="500" border="1"> <tr> <td> <span class="text">Text nrjkfb bfd df bfdfbhj</span> </td> </tr> <tr> <td> <span class="text">Text hjkbjkbjk</span> </td> </tr> </table> I have a table that looks like this: Code: <table style="height: 100%;" cellspacing=0 cellpadding=0 border=1> <tr><td colspan=2 style="height: 100px;"> <center> <span style="font-size: 24pt; text-align: center;"> <img src="H&R banner.jpg" border=0></span></center></td></tr> <tr> <td style="width: 200px;"> <center> <span style="text-align: center;"> MARGIN<br> (latest news)<br> (possibly links) </span> </center> </td> <td> <table style="width: 100%; height: 100%" cellspacing=0 cellpadding=0 border=1> <tr> <td style="height: 50px;"> <center> <span style="font-size: 14pt;">menu bar</span> </center></td> </tr> <tr> <td> <center> <span style="font-size: 24pt; text-align: center;"> CONTENT </span> </center> </td> </tr> </table> </td> </tr> </table> I'm having trouble controling the width of the first bolded table cell. This happens in IE9. I have it set to 200px, but for some reason it wants to be wider than that (I can tell because the text seems to be centering within the first 200px of its width, but it's not centered within the whole cell). I can fix this by specifying a % width (as in style="width: 25%;"), but I'd prefer to stay away from percentages. I can also fix the problem by specifying the width of the next cell (to its right, in bold above) to some specific value, but then this fixes the size of the whole table, and I would like to keep it variable. Does anyone know why the width likes to increase to more than I specified, and if so, how do I fix this problem? Hi all, I am a totally new to html, "yesterday I could not even spell it". I am working on a simple project where I have used a table to store page information (text and pictures), I read it somewhere it is the best way to do it. I figured out how to set the context width in the cell (<td width="20">) but how do set the width of the cell? Remember, I am not building "The Windsor Castle" just a little cuby house in the back so everything should be as simple aspossble, not necessarily the fastets and most versatile. Thanks in advance. I'm a beginner in HTML. I would like to make a row with two cells, the first one being 200 pixels wide and the second cell stretching out to fill up the rest of the horizontal space... I thought that putting in width=100% in that <td> tag would do it but if I do that, that cell covers up my first cell (the 200 px one). How can I go about doing that? Thanks!! Hello, I am having trouble converting the following example table into a nice tableless layout: Code: <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td><img src="./left_image.gif" border="0" /></td> <td style="background: url(./bg_image.gif) top left repeat-x;" width="100%">Content</td> <td><img src="./right_image.gif" border="0" /></td> </tr> </table> The main problem is that center 100% width cell. A 100% width div with a div either side doesn't work... Any ideas on how I would go about this? I actually feel a bit ridiculous because i can't solve a problem that will probably be as easy as hell... anyway, i have a table with some collspans and rowspans in it, but i can't seem to be able to set the width for the site in IE... Here's a simple representation of the table, since it's generated dynamically with PHP, so the number of rows and columns is not always the same...but the structure is: HTML Code: <table> <tr> <th rowspan=2 style="min-width=120px;">left column header</th> <th colspan=2 style="min-width=120px;">column 1 title</th> <th colspan=2 style="min-width=120px;">column 2 title</th> </tr> <tr> <td style="min-width=60px;">value1</td> <td style="min-width=60px;">value2</td> <td style="min-width=60px;">value1</td> <td style="min-width=60px;">value2</td> </tr> <tr> <td>row1 name</td> <td>row1 col1 value1</td> <td>row1 col1 value2</td> <td>row1 col2 value1</td> <td>row1 col2 value2</td> </tr> </table> So it should look a bit like this: Code: ------------------------------- | 120px | 120px | 120px | | |---------|---------| | |60px|60px|60px|60px| |---------|----|----|----|----| |rowname1 |val1|val2|val1|val2| |---------|----|----|----|----| |rowname2 |val1|val2|val1|val2| ------------------------------- there can be more rows with rowname, and more columns with the colspans... now in mozilla firefox this works just fine, but not in IE...even worse, if one of the values in the columns that are supposed to be 60px wide is negative, IE inserts a break between the '-' symbol and the numbers... i'm using HTML 4.01 Strict by the way... Hi, I have a template made that my friend made in photoshop and slice the image to be able to put them in html. The problem is when I put too much text the cell on both side of the middle one are resizing too. is there a way to lock them from resizing and get only the cell that i want to resize? I'll put the html code here and thx a lot! BTW When it say: this cell resize verticaly - it mean that I want this cell to resize and not the others Code: <!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> <title>web_DIV</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> </head> <body bgcolor="#000000"> <table id="tableau_01" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td rowspan="4" width="50%" height="316" background="images/web_div_01.jpg"> </td> <td colspan="6" width="992" height="61" background="images/web_div_02.jpg"> </td> <td rowspan="4" width="50%" height="316" background="images/web_div_03.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="61" alt="" /></td> </tr> <tr> <td rowspan="3" width="55" height="255" background="images/web_div_04.jpg"> </td> <td rowspan="3" width="23" height="255" background="images/web_div_05.jpg"> </td> <td width="772" height="26" background="images/web_div_06.jpg"> </td> <td colspan="2" rowspan="3" width="21" height="255" background="images/web_div_07.jpg"> </td> <td width="121" height="26" background="images/web_div_08.jpg"> ></td> <td> <img src="images/spacer.gif" width="1" height="26" alt="" /></td> </tr> <tr> <td rowspan="4" width="772" height="435" background="images/web_div_09.jpg"> the text </td> <td width="121" height="4" background="images/web_div_10.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="4" alt="" /></td> </tr> <tr> <td width="121" height="225" background="images/web_div_11.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="225" alt="" /></td> </tr> <tr> <td width="50%" height="100%" background="images/web_div_12.jpg"> <p>this cell resize verticaly</p> </td> <td colspan="2" width="78" height="100%" background="images/web_div_13.jpg"> this cell resize verticaly</td> <td colspan="3" width="142" height="7" background="images/web_div_14.jpg"> this cell resize verticaly</td> <td width="50%" height="100%" background="images/web_div_15.jpg"> this cell resizeverticaly</td> <td> <img src="images/spacer.gif" width="1" height="7" alt="" /></td> </tr> <tr> <td rowspan="5" width="50%" height="345" background="images/web_div_16.jpg"> </td> <td colspan="2" rowspan="2" width="78" height="223" background="images/web_div_17.jpg"> </td> <td colspan="2" rowspan="2" width="21" height="223" background="images/web_div_18.jpg"> </td> <td rowspan="4" width="121" height="332" background="images/web_div_19.jpg"> </td> <td rowspan="5" width="8" height="345" background="images/web_div_20.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="199" alt="" /></td> </tr> <tr> <td width="772" height="24" background="images/web_div_21.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="24" alt="" /></td> </tr> <tr> <td colspan="5" width="871" height="81" background="images/web_div_22.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="81" alt="" /></td> </tr> <tr> <td colspan="2" width="78" height="28" background="images/web_div_23.jpg"> </td> <td colspan="2" width="773" height="28" background="images/web_div_24.jpg"> </td> <td width="20" height="28" background="images/web_div_25.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="28" alt="" /></td> </tr> <tr> <td colspan="6" width="992" height="13" background="images/web_div_26.jpg"> </td> <td> <img src="images/spacer.gif" width="1" height="13" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="8" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="55" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="23" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="772" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="20" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="121" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="8" height="1" alt="" /></td> <td></td> </tr> </table> </html> Hi, I am having some problems with the tables and cells on the following page: http://img179.imageshack.us/my.php?i...problemjs7.png What I am trying to do is insert text in the cell indicated by the red arrow. At the moment it has no width (you can see the two cell walls where it should be). However when I try to drag the right wall out, or when I click in it and start typing, it does expand to the right (which i want it to do), however it pushes all the cells to the left it left which is messing up the layout. What I would like to happen is for the cell to expand out to the right, leaving everything else in their proper place. If anyone can offer any help, I would appreciate it very much! Thanks. Hello, I've recently noticed that IE renders this table a bit differently than most browsers (Firefox, Opera, Safari, etc). The real page is much more complicated and uses proper styling, but I simplified it into the code below. The inline CSS sets the height of each individual cell and then the last cell is not provided with a height. I would love for the last cell to take the rest of the available height. I've tried many things to try and get this to work (like setting the height to 100%). The page renders how I expect it to in every browser I've tested except for the IE series. It seems as though Internet Explorer decides to ignore my row heights and calculate its own for some reason. Also, using a fixed height for the last cell is not possible due to how dynamic the web page is. Does anyone have any tips? HTML Code: <table style="table-layout:fixed;" border=1 width=100%> <tr> <td style="height:17px;width:150px;"> </td> <td style="height:600px" colspan=3 rowspan=5>This should span all of the rows and the remaining columns</td> </tr> <tr> <td style="height:17px;width:150px;"> </td> </tr> <tr> <td style="height:17px;width:150px;"> </td> </tr> <tr> <td style="height:17px;width:150px;"> </td> </tr> <tr> <td>This cell should take the rest of the available column height area</td> </tr> </table> Thank you. Hello, I have a table more o less defined as follows: Code: <table border = 2> <tr><th colspan=2 align=center>GENERAL TABLE NAME</th></tr> <tr><th colspan=2 align = center>ANOTHER GENERAL NAME</th></tr> <tr><th>Col1</th><th>Col2</th></tr> <tr><td>Att1</td><td>Att2</td></tr> <tr><td colspan=2> <textarea cols=??? rows=???> <%=XMLString%=> </textarea></td> </tr> </table> I have the following problem: The table is shown but it needs to be printed... so I cannot use a textarea with scrolling option.... I need the textarea to be completely seen. What I need to write is a XML string... Is there a way of knowing the number of lines contained by this string (so I could put it in the rows parameter)? Another thing, I would like the textarea to completely fit within the 2 columns.... how can I do it? May be is there another way of doing it, without using textarea? Thanks for your help Hello all, I have the following table, however, my height seem to be changing: Code: <table width="100%"> <tr> <td height="50" width="50%"> CELL1</td> <td rowspan="3" valign="top" width="50%"> WRITING GOES HERE</td> </tr> <tr> <td height="50" width="50%"> CELL2</td> </tr> <tr> <td height="100%" width="50%"> CELL3</td> </tr> </table> I want cell1 and cell2 to always remain at 50px. cell3, may vary in size depending on how much information is entered into the 'WRITING GOES HERE' section. At present when there is a lot of wiriting in the 'WRITING GOES HERE', cell1 and cell2's height will be much larger that 50px. Any ideas how i can get cell1 and cell2 to remain constan and cell3's height to vary? Much Appreciated. Hi all, Having a bit of trouble with a table layout in IE. The following link renders correctly (or at least as I would like) in Firefox yet in IE the header and navigation bars are too think. I've tried adding a height attribute to all td's concerned, but to no avail. here's the link: http://www.events.ex.ac.uk/ivfdf2009...s/template.php any help you can offer muchly appreciated! hi, i have a jsp page, in this page i am displaying data retrieved from mysql database. Now the problem is i must color table cell based on cell value. how to implement this.please give me an sample or working code foe this problem.( any code is accepted) preferably html or javascript. i.e if cell value is "late" then display that cell in red color else display the cell in green color please help me. Thanks ad Regards Akash Here is my current code: <TABLE width="215" border="0" cellspacing="0" cellpadding="0"> <tr> <td><TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> VARIABLE TEXT </td> <td align="left"> IMAGE </td> </tr> </TABLE></td> </tr> <tr> <td> random text that is lengthy </td> </tr> </TABLE> My problem is that I want the image to be displayed right next to the variable text . but since the variable can be any length, it is not getting displayed right next to the image. It is turning out to have a large gap in between the variable and the image. The variable can be any length... it could be "hi" or "hellooooooooo" but the image still needs to be displayed exactly to the right of it. How can I fix this? ok, im trying to make a shoutbox and i need the box to be a max width of 200px. But, since the shoutbox entries are going to be dynamic, theres a problem. In a table cell, if you have a string of characters without spaces, it will extend the width of the table cell (and entire table if appropriate) in order to accomodate this... The problem is, i need the table width to stay constant... 200px. Ive tried using normal width attributes and css in each of the td, table, and div (around the table) tags, but that does not work-- the table still extends horizontally in order to display the string. Is there anyway I can staticly set the table width to 200px and keep it that way? Frankly, i dont care what happens to the extra long string, short of deleting it altogether, i just need the table to stay a constant width Hi, I am using tables in dreamweaver, making a bottom border for each cell, but I dont want it to go all the way across, I want a short bottom line, here is the code: <td colspan="2" valign="top"style="border-bottom: 1px solid #AF0A10"> let me know how to make the bottom line at like 50% Thanks! -Sean |