仅使用一个表冻结表列和行

时间:2013-06-09 14:31:24

标签: php html scroll html-table freeze

我有一个从应用程序填充的动态表。 我的问题是我需要某种方法来冻结第一行和前四列但仅使用一个表,显然是因为我将把表再次发布回应用程序。

我目前的代码:

....
<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>";

已经尝试过:
Big Four方法
This

有什么好主意吗? 我再次不能使用多种表格方法。

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以使用数据表插件FixedColumns,只需将参数“iLeftColumns”设置为需要从表格左侧修复的列数。标题已默认修复。

相关问题