“表格的列”的意思给你几个网址,去下几本HTML的书吧
www.chinaz.com
http://download.chinaitlab.com/sort/20_1.htm
www.pcsoftware.com.cn  速度狂快!!
http://download.chinaitlab.com/sort/20_1.htm
www.ddvip.net 速度狂快!!100--500 k/s!!

解决方案 »

  1.   

    table.cols 
    表示所有行 列集合
      

  2.   

    可在浏览器中打开的网页中查看源代码,看看DataGrid到底是生成了什么,再研究一下就可以了。
      

  3.   

    uffeng(阿呆)
    为什么我 alert(table.cols) 是  0 呢   有好多列呢
      

  4.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=19BE9FAC-437A-4863-910D-9427554561B2
      

  5.   

    这是别人写的排序的一个js函数 能告诉我什么意思吗?
    function sortTable(col, tableToSort)
      {
        var iCurCell = col + tableToSort.cols; //这是什么意思啊
                             ~~~~~~~~~~~~~~~~~  
        var totalRows = tableToSort.rows.length;
        var bSort = 0;
        var colArray = new Array();
        var oldIndex = new Array();
        var indexArray = new Array();
        var bArray = new Array();
        var newRow;
        var newCell;
        var i;
        var c;
        var j;
        // ** POPULATE THE ARRAY colArray WITH CONTENTS OF THE COLUMN SELECTED
        for (i=1; i < tableToSort.rows.length; i++)
          {
            colArray[i - 1] = setDataType(tableToSort.cells(iCurCell).innerText);
            iCurCell = iCurCell + tableToSort.cols;
          }
        // ** COPY ARRAY FOR COMPARISON AFTER SORT
        for (i=0; i < colArray.length; i++)
          {
            bArray[i] = colArray[i];
          }
        // ** SORT THE COLUMN ITEMS
        //alert ( colArray );
        colArray.sort();
        //alert ( colArray );
        for (i=0; i < colArray.length; i++)
          { // LOOP THROUGH THE NEW SORTED ARRAY
            indexArray[i] = (i+1);
            for(j=0; j < bArray.length; j++)
              { // LOOP THROUGH THE OLD ARRAY
                if (colArray[i] == bArray[j])
                  {  // WHEN THE ITEM IN THE OLD AND NEW MATCH, PLACE THE
                    // CURRENT ROW NUMBER IN THE PROPER POSITION IN THE
                    // NEW ORDER ARRAY SO ROWS CAN BE MOVED ....
                    // MAKE SURE CURRENT ROW NUMBER IS NOT ALREADY IN THE
                    // NEW ORDER ARRAY
                    for (c=0; c<i; c++)
                      {
                        if ( oldIndex[c] == (j+1) )
                        {
                          bSort = 1;
                        }
                          }
                          if (bSort == 0)
                            {
                              oldIndex[i] = (j+1);
                            }
                              bSort = 0;
                            }
              }
        }
      // ** SORTING COMPLETE, ADD NEW ROWS TO BASE OF TABLE ....
      for (i=0; i<oldIndex.length; i++)
        {
          newRow = tableToSort.insertRow();
          for (c=0; c<tableToSort.cols; c++)
            {
              newCell = newRow.insertCell();
              newCell.innerHTML = tableToSort.rows(oldIndex[i]).cells(c).innerHTML;
            }
          }
      //MOVE NEW ROWS TO TOP OF TABLE ....
      for (i=1; i<totalRows; i++)
        {
          tableToSort.moveRow((tableToSort.rows.length -1),1);
        }
      //DELETE THE OLD ROWS FROM THE BOTTOM OF THE TABLE ....
      for (i=1; i<totalRows; i++)
        {
          tableToSort.deleteRow();
        }
      }
      

  6.   

    这个函数有问题 我帮你改了一下
    function sortTable(col, tableToSort)
      {
     var iCurCell = col 
        var totalRows = tableToSort.rows.length;
        var bSort = 0;
        var colArray = new Array();
        var oldIndex = new Array();
        var indexArray = new Array();
        var bArray = new Array();
        var newRow;
        var newCell;
        var i;
        var c;
        var j;
        // ** POPULATE THE ARRAY colArray WITH CONTENTS OF THE COLUMN SELECTED
        for (i=1; i < tableToSort.rows.length; i++)
          {
            colArray[i - 1] = tableToSort.rows(i).cells(iCurCell).innerText
            iCurCell = iCurCell + tableToSort.cols;
          }
        // ** COPY ARRAY FOR COMPARISON AFTER SORT
        for (i=0; i < colArray.length; i++)
          {
            bArray[i] = colArray[i];
          }
        // ** SORT THE COLUMN ITEMS
        //alert ( colArray );
        colArray.sort();
        //alert ( colArray );
        for (i=0; i < colArray.length; i++)
        {
         tableToSort.rows(i+1).cells(col).innerText=colArray[i];
        }
    }
      

  7.   

    net_lover(孟子E章) 
    不会吧 应该是列数吧
     那
      var iCurCell = col + tableToSort.cols; //这是什么意思啊
      

  8.   

    >> var iCurCell = col + tableToSort.cols; //这是什么意思啊
    就是col的值加table的列数啊
      

  9.   

    cnhgj(戏子▄︻┳═一打你家玻璃)col的值加table的列数啊 具体是什么意思 啊 这是给datagrid的列排序的函数