2014-09-29 76 views
1

我只是好奇,为什么行从1开始,列从0开始。有没有什么特别的理由,或者我错过了一些重要的东西?为什么不只是从0或1开始(一致性)。PHPExcel行从1开始,列为0

/** 
* Set a cell value by using numeric cell coordinates 
* 
* @param string $pColumn Numeric column coordinate of the cell (A = 0) 
* @param string $pRow Numeric row coordinate of the cell 
* @param mixed $pValue Value of the cell 
* @param bool $returnCell Return the worksheet (false, default) or 
    the cell (true) 
* @return PHPExcel_Worksheet|PHPExcel_Cell 
    Depending on the last parameter being specified 
*/ 
public function setCellValueByColumnAndRow($pColumn = 0, 
              $pRow = 1, 
              $pValue = null, 
              $returnCell = false) 
{ 
    $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValue($pValue); 
    return ($returnCell) ? $cell : $this; 
} 

回答

3

的原因是什么后,原本是基于旧的PEAR SEW也有从零开始的列ID

一个错误的决定更早版本的向后兼容性