Using a variable in a for loop: is it proper practice or is there a better approach
Use array_chunk() to split $rows into rows. Each row will be double high $doubleRows, so store the values in a small multi-dimension array $tablerows before echoing the rows.

// One single row.
$rows = array(
    "A" =&gt; 1,
    "B" =&gt; 2,
    "C" =&gt; 3,
    "D" =&gt; 4,
    "E" =&gt; 5,
    "F" =&gt; 6,
    "G" =&gt; 7,
    "H" =&gt; 8,
    "I" =&gt; 9,
    "J" =&gt; 10,
    "K" =&gt; 11,
    "L" =&gt; 12,
    "M" =&gt; 13
);

// Split into 1 or more rows of 8 columns each.
$doubleRows = array_chunk( $rows, 8, true );

// Rows are now double high.
// Keys on the first row and values on the second.
foreach ( $doubleRows as $columns ) {

    // Reset rows.
    $tableRows = array();
    foreach ( $columns as $key =&gt; $value ) {
        $tableRows['keys'][] = "&lt;td&gt;$key&lt;/td&gt;";
        $tableRows['values'][]  = "&lt;td&gt;$value&lt;/td&gt;";
    }

    echo "&lt;tr&gt;", join( '', $tableRows['keys'] ), "&lt;/tr&gt;";
    echo "&lt;tr&gt;", join( '', $tableRows['values'] ), "&lt;/tr&gt;";
}


Style

You used a lot of end comments. I try to avoid them and I try to avoid obvious comments like, // Start the row. To me, the &lt;tr&gt; tag is pretty self explanatory, but if it is not to you, then I understand why you did it.

Wrap long comments and use proper punctuation and capitalization. Comments are for humans. PHP strips them out. If you are the only person who ever sees your code, write your comments for the (different) person you will be in six months. The future you may appreciate comments that look like sentences and paragraphs. 

Be consistent with your indentation and white space. Always indent the same number of characters. This foreach is indented 4 spaces (or 1 tab). The conditional statement is indented 12 spaces (or 3 tabs).

    for ($index=$startIndex; $index&lt;=$endIndex; $index++){//creates the rows
            if($rowEvenOdd == 1) {//if the row is odd, grab and display the key


I would write it like this:

    // Create table rows.
    for ( $index = $startIndex; $index &lt;= $endIndex; $index++ ) {
        if ( $rowEvenOdd == 1 ) {
            // Row is odd. Grab and display the key.


I added some white space so it wouldn't look all scrunch up. I find it easier to read like that. The comment after the conditional tells you what the condition is instead of what the conditional does.

If this is your style for writing one line conditionals, I guess it is fine, but it looks scrunch up and harder to read.

if(array_key_exists($index, $arrayOfKeys))
    {$thisvalue = $array[$arrayOfKeys[$index]];}
    else {$thisvalue ="&amp;nbsp;";}


I prefer this:

if ( array_key_exists( $index, $arrayOfKeys ) ) {
    $thisvalue = $array[$arrayOfKeys[$index]];
} else {
    $thisvalue ="&amp;nbsp;";
}


Or this:

if ( array_key_exists( $index, $arrayOfKeys ) )
    $thisvalue = $array[$arrayOfKeys[$index]];
else
    $thisvalue ="&amp;nbsp;";


I tend to not add white space near brackets [] and to add it in parenthesis ().

Except for $thisvalue and $thiskey all your variable name use camel case. $thisValue and $thisKey would be more consistent.