code: private void determineFootnoteHeading(TableCandidate tc)  {
      	/*
      	 * Gets the maximal column number based on all table rows before footnote
      	 */
      	int maxColumnNum = 0;
      	for (int i = 0; i < tc.getFootnoteBeginRow(); i++) {
      		TableRow row = tc.getRows().get(i);
      		if (row.getCells().size() > maxColumnNum) {
      			maxColumnNum = row.getCells().size();
      		}
      	}
      	tc.setMaxColumnNumber(maxColumnNum);
  
      	/*
      	 * Counts the number of table column heading lines 
      	 * TODO: this heading finding algorithm should be improved
      	 */
      	int headingLineNumber = 0;
      	for (int i = 0; i < tc.getFootnoteBeginRow(); i++) {
      		TableRow row = tc.getRows().get(i);
  		    if (row.getCells().size() < maxColumnNum) {
  		    	headingLineNumber++;
  		    }
  		    else break;
  		}
      	/*
      	 * Based on observation, usually we have missing cells, especially happen in the first column 
      	 */
      	if (headingLineNumber>0) headingLineNumber--; 
      	tc.setHeadingLineNumber(Math.max(0, headingLineNumber)); 
      }
docs: Adjusts the table heading rows and footnote rows
  
  @param tc
  the object of the table candidate