Javascript-форум (https://javascript.ru/forum/)
-   Элементы интерфейса (https://javascript.ru/forum/dom-window/)
-   -   Вопрос по таблицам (https://javascript.ru/forum/dom-window/11824-vopros-po-tablicam.html)

JopS 15.09.2010 18:11

Вопрос по таблицам
 
Здравствуйте подскажите пожалуйста. У меня таблица на весь экран со вложенной таблицей и в ней не работает параметр высота 100% как сделать чтобы вложенная таблица в предпоследней ячейку была на все свободное пространство в ней.
Вот код:
<table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td height="128">&nbsp;</td>
  </tr>
  <tr>
    <td height="32">&nbsp;</td>
  </tr>
  <tr>
    <td align="left" valign="top"><table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="168px">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</td>
  </tr>
  <tr>
    <td height="32">&nbsp;</td>
  </tr>
</table>

subzey 15.09.2010 19:38

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<!-- <link rel="stylesheet" type="text/css" href="style.css" /> -->
		<!-- <script type="text/javascript" src="js/script.js"></script> -->
		<style type="text/css">
			html, body {height: 100%; margin: 0px;}
		</style>
	</head>
	<body>
<table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td height="128">&nbsp;</td>
  </tr>
  <tr>
    <td height="32">&nbsp;</td>
  </tr>
  <tr>
    <td align="left" valign="top" style="position: relative">
		<table id="inner" style="position: absolute; top: 0px; bottom: 0px" width="100%" height="100%" border="1" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="168px">&nbsp;</td>
			<td>&nbsp;</td>
		  </tr>
		</table>
	</td>
  </tr>
  <tr>
    <td height="32">&nbsp;</td>
  </tr>
</table>
		
	</body>
</html>

Разве что так. В IE6 работать не будет.

HelpeR 16.09.2010 17:35

Здравствуйте! У меня тут же вопрос по таблице. Почему то в IE8 не срабатывает свойство valign = 'top' у ячейки.
table.rows[c].cells[k].setAttribute('valign', 'top');
table.rows[c].cells[k].valign = 'top';
уже и так и так прописал, все равно контент не тянется вверх

HelpeR 16.09.2010 17:44

вопрос решил
table.rows[c].cells[k].style.display = 'table-cell';
table.rows[c].cells[k].style.verticalAlign = 'top';


Часовой пояс GMT +3, время: 10:36.