【发布时间】:2013-06-09 14:31:24
【问题描述】:
我有一个从应用程序填充的动态表。 我的问题是我需要一些方法来冻结第一行和前四列,但只使用一个表,显然是因为我会将表再次发布回应用程序。
我当前的表代码:
....
<form name="myform" method="post" action="test123.php" onsubmit="set_value();">
//this form is used to post back the data after user updates it.
<br />
<table align="center" id="dataTable">
<thead>
<tr class="header">
...
$arratt49 = (explode(',',$response49,-1)); //sending an array from application
$dayscounter = sizeof($arratt49);
$sizemon = strlen($month1);
if($sizemon > 0)
{
echo "<th class='text ce6'>No.</th>";
echo "<th class='text ce6'>Emp code</th>";
echo "<th class='text ce6'>Name</th>";
echo "<th class='text ce6'>Department </th>";
for($kkk=0;$kkk<$dayscounter;$kkk++)
{
echo "<th class='text ce7'>";
echo $arratt49[$kkk];
echo "</br>";
echo $arratt49[$kkk+1];
echo "</th>";
$kkk = $kkk +1;
}
}
</tr>
</thead>
<tbody>
<tr>
....//Here goes the Body
for($k=0;$k<=$arrcnt;$k++)
{
echo "<td class='text ce2'>";
echo $counter;
echo "</td>";
echo "<td class='text ce2'><INPUT type='text' name='code[]' size = '8' readonly='true 'value='";
echo $arratt[$k];
echo "'";
echo "</td>";
echo "<td class='text ce2'><INPUT type='text' name='name[]' size = '40' readonly='true' value='";
echo $arratt[$k+1];
echo "'";
echo "</td>";
echo "<td class='text ce2'><INPUT type='text' name='dept[]' size = '12' readonly='true 'value='";
echo $arratt[$k+2];
echo "'>";
echo "</td>";
【问题讨论】:
-
@test1604 :感谢您的建议,我检查了,上述方法仅适用于列,我需要在同一个表中冻结 1 ROW 和 4 COLUMNS。
-
你需要冻结页眉+第一行吗?
-
标题(或第一行 + 4 第一列。
-
我上传了一张图片,说明我想冻结的区域。
标签: php html scroll html-table freeze