HTML - Dynamic Hiding Table's Column
I want to dynamically hide column in table. There's many working examples on the web, such as
http://www.ahfb2000.com/webmaster_he...ead.php?t=3356 But I lack one feature. When I hide column (all cells in column) via style.visibility="hidden", the remaining column (cells) doesn't adjust its width. I would like to somewhat make the table adjust all cells widths (push together), as if the hidden column (cells) wasn't there at all. Is it possible ? Thanks. Similar TutorialsI want to hide a table column when a window gets too a certain width. I've clocked onto the media tags, and I've used them to re-structure my navigation bar and I know the media tags work beautifully, I just need to remove a column from a table, the last column too be exact, using just HTML. Alternatively, If I can't remove it how can I make it seem like it's gone? I've tried setting the column width too 0px but that doesn't work. there's an image inside the column though, and I reckon that might be what's messing this up. Any suggestions guys? Basically what I want is a floating table head that follows you around when you scroll the table. Did all that, but the problem is that you need to cut out the head of the table to make it float. The problem comes where you have a table that has no column width set so the column width is determined by the content of tbody. I'm trying to make the browsers keep rendering the entire table, but hide the tbody so the columns won't loose their widths. It works fine in Mozilla and Opera, but IE has problems. Here is the code: HTML Code: <html> <head> <style type="text/css"> table { border-collapse: collapse; } tbody td { line-height: 0px; visibility: hidden; } </style> </head> <body> <table id="table_test" border="0" cellpadding="0" cellspacing="0" style="background-color: red;"> <thead> <tr> <th>column1</th> <th>column2</th> <th>column3</th> <th>column4</th> <th>column5</th> <th>column6</th> <th>column7</th> </tr> </thead> <tbody> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>jaz sem pa daljsi tekst jaz sem pa daljsi tekst jaz sem pa daljsi tekst</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> <tr> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>nekaj</td> <td>pac</td> <td>mora</td> <td>mora</td> </tr> </tbody> </table> </body> </html> And the result can be seen in the attached picture. Any ideas how to solve this or another way to preserve the thead column widths? Hi: I would like to present to my users a 3-column table of 'House for Sale' advertisements. This is not a commercial venture but will only be for the use of my Senior Mobile Home Park residents. Each of the three columns should contain x number of rows with each column cell containing a tiny pic (from a house.jpg file) and underneath the pic would be a few general details of the price, address, agent selling, etc. The .pic would be clickable and would then bring up a more enlarged picture of the house and complete details of the house for sale. My first puzzle is how to make this list of rows of advertisements *variable*. I guess I have to 'build' the page in my server according to how many ads are currently active ?? Any first thoughts are welcome. Thanks, -Mel Smith Hey guys, Okay so i have a question over a table that I am generating with data from a database. The way i have my table set up is like this: Recipe Name-----Prep Time-----Total Time-----Rating ========================================= some data here 12 mins 20 mins 4.5 some data here 12 mins 20 mins 4.5 some data here 12 mins 20 mins 4.5 some data here 12 mins 20 mins 4.5 So what i want to know is if I could make the Column Header (RECIPE NAME) into a link that way the user can click it and it would sort the recipe names in ascending order. When i open the page i am already displaying all the data form the database in this table. but i want to allow the user to be able to sort the recipe names. So i would have to i guess (REFRESH) the page automatically?? I already have teh code to sort my data, what I need to know is how exactly to go about making the column header into a link to SORT and then refresh the page Here is my code I currently have used to create the TABLE and populate it using a while loop to send the data from the DB into the table: <table border="2" width ="500"> <tr> <th>Recipe Name</th> <th>Prep Time</th> <th>Total Time</th> <th>Rating</th> </tr> <!--While statement used to pass data from DB into tables --> <? while( $row = mysql_fetch_array( $result ) ) { ?> <tr> <td><a href="ShowRecipe.php?id=<?=$row['id'] ?>"><?=$row['name'] ?></a></td> <td><?=$row['preptime']?> mins</td> <td><?=$row['totaltime']?> mins</td> <td><?=$row['rating']?></td> </tr> <? } ?> </table> hi i am displaying the data retrived from the database in table format. say using query select . col1 col2 col3 col4 12 15 15 13 15 16 the data displayed in col1,col2,col3 are retrieved from the database. now the problem is now i have to compute value for col4 (i.e col4= (15+15)/4) using the values in col2 ,col3. how to perform this. i am using sql as backend and jsp for front end. please send some similar examples or working code for this or any suggestions are appreciated. Thanks and regards Manjunath I have 10 rows compose of 3 textbox per row. After pressing submit button, they are post to the next page to a table. But my problem is if only 3 rows have data the other rows is still shown in a table but blank with borders. So I want my table to show the rows who only have data The following piece of code delivers a table with fixed width 666px and appr. 200px 466px wide columns, when opened within IE. Long text fits into the columns, long strings break at the border. When opening up within MS Word, the column width seem to ignore the styles. Does anybody know alternative commands delivering the same result in MS Word? Thanks, Andreas <table style="width: 666px; table-layout:fixed; word-wrap: break-word;" cellspacing="0"> <col width="30%"> <col width="70%"> <tr> <td>Floating Rate Payer Calculation Amount:</td> <td>|TRADE_CURRENCY| |CD_NOTIONAL|</td> </tr> </table> Hi, I am new to web design and am trying to design company website without using a site builder. I have built up my container with 3 boxes inside. In the largest I want text on the right and a 1 column 2 row table on the right - to be adjacent to each other but I can't get it to work. I don't want the text to wrap around the table. Please help. Not sure if I worded that right. But I have a 3 column table with three rows. And I want a row with no columns at the top that is the full width, so I can put a title in there. how do I do that? Here is my current title. Thank you. Code: <table id="box-table-b"> <thead> <tr> <th width="175" scope="col">Website</th> <th width="69" scope="col">Lowest <br /> Price</th> <th width="50" scope="col">BUY</th> </tr> </thead> <tbody> <tr> <td>xxxx</td> <td>x</td> <td><a href="#">Here</a></td> </tr> <tr> <td>xxxxx</td> <td>x</td> <td><a href="#">Here</a></td> </tr> </tbody> </table> I need a three column table in which the center column will have multiple rows, the number will vary. For exampe, this works. I need a third column that will look like the first, just one row corresponding to the seven rows in the second column. Code: <table border=1> <tbody> <tr><td rowspan=8>Dry skin</td></tr> <tr><td>46.0 </td></tr> <tr><td>9.0 </td></tr> <tr><td>35.3 </td></tr> <tr><td>12.5 </td></tr> <tr><td>20.8 </td></tr> <tr><td>27.0 </td></tr> <tr><td>4.0 </td></tr> </tbody> </table> If I do this Code: <table border=1> <tbody> <tr><td rowspan=8>Dry skin</td></tr> <tr><td>46.0 </td></tr> <tr><td>9.0 </td></tr> <tr><td>35.3 </td></tr> <tr><td>12.5 </td></tr> <tr><td>20.8 </td></tr> <tr><td>27.0 </td></tr> <tr><td>4.0 </td></tr> <tr><td>third column, same row? </td></tr> </tbody> </table> another row is started. I just want third column that has one row corresponding, correlated with the seven rows in the second column. I don't know how to do that. Hi everyone Can you please help. I need to create a 3 column table, left column, content column and right column. I want the left column to have rounded corners. I am having a tough time doing this. Any help is appreciated Thanks Hi! I've been trying to figure out why columns in my HTML-table get weird widths. ie. this code: HTML Code: <table width="950" cellpadding="0" cellspacing="0"> <tr> <td colspan="5"> column1 </td> <td colspan="5"> column2 </td> </tr> <tr> <td colspan="5"> <input type="text" value="column3" maxlength="20" style="width:165px;" /> </td> <td colspan="5"> column4 </td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> <td>10</td> </tr> </table> gives me the result: Is there any way I can fix this so each of the columns get's equal size? Preferably without actually having to have to set the width on each of the bottom columns. If not, could anyone explain to me why it's acting this way? Thanks. hey guys - I was trying to add a little more kick to my website today and making the text appear in little windows I guess you would say - (I know the site is not complete and links are intentionally broken) if you look on the right of the page you will notice I added 2 table cells to round off the white - now the problem I can not figure out how to bring the white area over to the rounded edges whether I need to make the cell wider or if I need to add another cell - any help is appreciated. source: Http://www.medicalpracticeexams.com/index.asp Thanks Hi, I have the following problem i'm trying to solve with HTML: I have a simple table with 3 columns. I want the table to have a 100% width of the screen. Furthermore the center column must ALWAYS have a width of 1000. The left and right column should just be there too fill the gaps up if you have a wider screen than 1000. Setting these left/right columns to width "100%" doesn't work because than it would just make the left column fill up the space and the right column will have a width of 0. How can I solve this? Some example could would be highly appreciated Thanks, betonboor Is it possible to set a table's width as something like this? HTML Code: <table width="100%-100px"> Good day, I am brand new here in this forum. So many knowledgeable folks here. I am relatively new to web design. I typically use templates and themes and tweak them. I can navigate a CSS doc and html to make changes, etc. However, I have a client who has an existing site that she wants to keep the aesthetic of and so I am using what the previous designer left. It is a simple html page with tables. Simple enough. Very elegant visually. No need to SEO really so it works. She has asked if we can make the left column of a two column table scroll independently. The page content is about over 6000px. The scroll column will contain a page outline and other text that will include internal targeted links. This is outside my skill set, but I want to learn. Have searched the net and found some suggestions but want it to be clean and ended up here. There is no style sheet other than the ie6 sheet. Page is he http://www.themedeaproject.com/proposaltestpage.html no graphics are loaded. Can anyone point me to a good tutorial or have any suggestions? Thanks! BlueEyedMonkey aka Tatyanna can i have fixed layout for only some part of a table? I want the first column of my table to be "auto" and the other columns to be "fixed" llike style='table-layout:fixed;'. How can I achieve this? Thanks! Hi guys, this is my first post an ive only started to use HTML, PHP and mySQL so here goes. The problem I am having is that i want a single line table to duplicate more lines of code when an onClick button is pressed. it basically goes Staff name Wage hours worked I:::::::I I:::::::::::::I I:::::::::::::::::I IButtonI When the button is pressed i want the form table to change to Staff name Wage hours worked I:::::::I I:::::::::::::I I:::::::::::::::::I I:::::::I I:::::::::::::I I:::::::::::::::::I IButtonI and so on. I am storing staff name etc as an array so i can easily calculate totals. Is there a way to do this dynamically without having to show / hide or else using DOM? Any help appreciated! 0 Answers Posted ( Reply | Quote ) Unsubscribe I've searched around quite a bit, read various articles and so-on and only really come to the conclusion that this is a lot harder than it should be! What I have is a simple page for a PHP script, it has a little form for entering keywords, and displays an image above this form. Now, what I want to do is place these in a table, and have that table resize to fit the viewable area of the user's browser-window. So, what I have is a table with three-rows: The title of the image The image itself The form for entering image keywords Now, what I would like to do is have the image scale to fill the middle cell, which by default eats up all available space leftover by the form and title cells. However, this isn't happening, I enter a height of 100% for the image but it seems to be using some other container to get its height. I'm generally well-versed in HTML, but this one has me stumped! Any help is appreciated, here is the basic HTML I'm using for what I had thought would be a simple page Code: <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" /> <meta name="author" content="Haravikk.com" /> <title>Add keywords</title> <style type="text/css"> body, html { height: 100%; margin: 0; text-align: center; } tr, td, textarea { width: 100%; } table { width: 99%; height: 100%; margin: 0 auto 0 auto; } table, td { border-width: 0; border-spacing: 0; padding: 0; } #image { height: 100%; } #tdTitle { height: 5%; } #tdImg { height: 75%; } #tdForm { height: 20%; } #formText { width: 100%; height: 75%; } </style> </head> <body> <table> <tr> <td id="tdTitle"><b>placeholder.png</b></td> </tr> <tr> <td id="tdImg"> <img id="image" src="http://haravikk.com/placeholder.png" alt="" /> </td> </tr> <tr> <td id="tdForm"> <form action="keywords.php" method="post"> <textarea name="keywords" id="fmrText"></textarea><br /> <input type="submit" /> </form> </td> </tr> </table> </body> </html> Now, I don't know if I could eliminate the table in favour of divs and do this, any suggestions to make the above html work, or to re-write it are welcome! The image provided is just to illustrate the problem |