dongluan5740 2013-06-09 14:31
浏览 74
已采纳

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

I have a dynamic table which is filled from an Application. My problem is that I need some way to freeze the first row and the first four columns BUT using only one table, obviously because I will be posting the table back again to the application.

My Current Table Code :

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

Already tried :
Big Four method
and also This

Any Good Ideas? Again I CANNOT use more than one table method.

enter image description here

  • 写回答

1条回答 默认 最新

  • dtn36013 2013-06-09 17:14
    关注

    You can use datatables plugin FixedColumns, just set parameter "iLeftColumns" to the number of columns needed to be fixed from the left side of table. Header already fixed by default.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?