table height设为100%后高度没有全屏显示
What does 100% height means?
Setting the 100% height of the table means the table will occupy 100% of the available space vertically. Here available space means space of it's parent control. If the height of the parent control is not 100% then height of the table couldn't be 100%.
If you are trying to set 100% height of the table directly contained the body of a html page the you need to first set the height of the body and html. The below code will work perfectly fine for the 100% table height.
关键是下面前两行
<html style="height: 100%;"><body style="height: 100%;"><table style="height: 100%;"> <tr> <td>....</td> </tr></table></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!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=gb2312" /> <title>测试</title> </head> <body> <div style="height:100%"></div> </body> </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <style type="text/css"> html { height: 100%} body {height:100%;margin:0px;padding:0px} table{height: 100%;width: 100%;} </style> </head><body> <table border=1> <tr> <td> <ul> <li>12 <li>34 </ul> </td> <td> <iframe name="" src="" width="100%" height="100%"></iframe> </td> </tr> </table> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <style type="text/css"> html { height: 100%} body {height:100%;margin:0px;padding:0px} table{height: 100%;width: 100%;} </style> </head> <body> <table border=1> <tr> <td> <ul> <li>12 <li>34 </ul> </td> <td> <iframe name="" src="" width="100%" height="100%"></iframe> </td> </tr> </table> </body> </html>