| | |
td under div
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 5
Reputation:
Solved Threads: 0
HTML and CSS Syntax (Toggle Plain Text)
<!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=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <table> <tr> <td></td><td></td> <div id="myDiv" style="display: none"> <input type="text" /><input type="text" /><input type="text" /> </div></tr></table> <a href="#" onclick="if(document.getElementById('myDiv').style.display=='block'){ document.getElementById('myDiv').style.display='hidden'; } else{ document.getElementById('myDiv').style.display='block';}">Show</a> </body> </html>
please help me...
Since you didn't explain in details, I can only guess. If structuring the three text fields with a table is your need, see if this modification helps:
HTML and CSS Syntax (Toggle Plain Text)
<!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=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <div id="myDiv" style="display: none"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="4"> <tr> <td>Text 1</td> <td><input type="text" name="textfield" /></td> </tr> <tr> <td>Text 2</td> <td><input type="text" name="textfield2" /></td> </tr> <tr> <td>Text 3</td> <td><input type="text" name="textfield3" /></td> </tr> </table> </div> <a href="#" onclick="if(document.getElementById('myDiv').style.display=='block'){ document.getElementById('myDiv').style.display='hidden'; } else{ document.getElementById('myDiv').style.display='block';}">Show</a> </body> </html>
•
•
Join Date: Jul 2008
Posts: 5
Reputation:
Solved Threads: 0
HTML and CSS Syntax (Toggle Plain Text)
<!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=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <table> <tr> <td>text1</td><td>text2</td><td>text3</td> <div id="myDiv" style="display: none"> <input type="text" /><input type="text" /><input type="text" /> </div></tr></table> <a href="#" onclick="if(document.getElementById('myDiv').style.display=='block'){ document.getElementById('myDiv').style.display='hidden'; } else{ document.getElementById('myDiv').style.display='block';}">Show</a> </body> </html>
this is your table having text fields:
this is your link to show the text boxes:
include this script in your page:
php Syntax (Toggle Plain Text)
<table width="291" id="prl" style="display:none"> <tr> <td width="95">message</td> <td width="196"><input name="message" type="text" id="message" ></td> </tr> <tr> <td>name</td> <td><input name="name" type="text" id="name"></td> </tr> </table>
this is your link to show the text boxes:
HTML and CSS Syntax (Toggle Plain Text)
<a href="#" onClick="toggle_it('prl')">show</a>
javascript Syntax (Toggle Plain Text)
<script language="javascript"> function toggle_it(itemID){ // Toggle visibility between none and inline if ((document.getElementById(itemID).style.display == 'none')) { document.getElementById(itemID).style.display = 'inline'; } else { document.getElementById(itemID).style.display = 'none'; } } </script>
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
•
•
•
•
this is your table having text fields:
javascript Syntax (Toggle Plain Text)
<script language="javascript"> function toggle_it(itemID){ // Toggle visibility between none and inline if ((document.getElementById(itemID).style.display == 'none')) { document.getElementById(itemID).style.display = 'inline'; } else { document.getElementById(itemID).style.display = 'none'; } } </script>
Thanx,
Shiriyal
http://shiriyal.blogspot.com/
if you problem solved add me as a reputation and mark it mark as solved
Shiriyal
http://shiriyal.blogspot.com/
if you problem solved add me as a reputation and mark it mark as solved
the table will show after clicks on the show hyperlink:
all this is done by javascript....
HTML and CSS Syntax (Toggle Plain Text)
<a href="#" onClick="toggle_it('prl')">show</a>
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
This is a fundamental HTML error.
The div tag cannot have the table tag or the tr tag as its parent. It must be either outside the table, or inside a td tag. And the only legal parent of a td tag is a tr tag.
Also, note that some browsers have trouble displaying a structure later, if it is initially not displayed.
The div tag cannot have the table tag or the tr tag as its parent. It must be either outside the table, or inside a td tag. And the only legal parent of a td tag is a tr tag.
Also, note that some browsers have trouble displaying a structure later, if it is initially not displayed.
Last edited by MidiMagic; Jul 31st, 2008 at 7:57 pm.
Daylight-saving time uses more gasoline
•
•
Join Date: Jun 2008
Posts: 55
Reputation:
Solved Threads: 3
Well spotted Midi.
One thing that should also be pointed out is that Javascript should not be used for site functionality. If someone doesn't have JS enabled (a number of companies have it disabled on all employee computers), then they won't be able to use the form.
If you "must" hide the table, then consider using CSS's visibility attribute.
One thing that should also be pointed out is that Javascript should not be used for site functionality. If someone doesn't have JS enabled (a number of companies have it disabled on all employee computers), then they won't be able to use the form.
If you "must" hide the table, then consider using CSS's visibility attribute.
Rexibit Web Services - Website Design - SEO - North Georgia Website Design
Don't just build it - CSS it.
Don't just build it - CSS it.
![]() |
Similar Threads
- createElement wont show table/div (JavaScript / DHTML / AJAX)
- div align=center (HTML and CSS)
- scrolling div ? (HTML and CSS)
- Div percentage height, centered and scrolling... or not... (Site Layout and Usability)
- Add textbox to editable div problem (JavaScript / DHTML / AJAX)
- Heading tags and div tags (HTML and CSS)
- DIV-X To VCD? (Geeks' Lounge)
Other Threads in the HTML and CSS Forum
- Previous Thread: IE7 adds blank space to all my website, in other browsers it looks normal
- Next Thread: Form select not working in IE
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






