2016-11-19 11 views
3

私はいくつかのマニュアルアスペクトをプロジェクトに緩和する関数を構築しようとしています。クライアントは私がテーブルに変換したExcelのリストを私に提供しました(Notepad ++とすてきなjQueryスクリプトのおかげで)。jQueryリストを作成するためにテーブルの列と行を反復する

私の目標は、個々のリストにすべての列ヘッダで構成される列ごと、および「X」細胞のを作ることですが、「X」細胞が一致していることをそれらのテキストを持っています各行の最初の<td>

私はそれを試して失敗したので、私は誰かが私が目指していたものを見て、私の欠陥を指摘することを望んでいると思っています。

私が取ったルートは、私はその後、私は私の行の反復と列の反復が後方であるが、任意の助けをいただければ幸いと思われる<div><ul><li>Column Header</li><li>text from first Row (X replaced)</li> etc...</ul></div>

を作成するために、反復処理でしょうきちんと指向配列にすべてを取得することでした。

This StackOverflow postは、私が必要とする要点を持っていますが、私が望むほど包括的ではありません。ここ

$('td').each(function() { 
 
    var currentHTML = $(this).html().toString(); 
 
    if (currentHTML === "&nbsp;") { 
 
     $(this).text("").addClass('nonX'); 
 
    } 
 
}); 
 

 
var columnIteration = $('tr:eq(0)').find('td').length; 
 
console.log(columnIteration); 
 
var corespondingTD = []; 
 
for (i = 1, z = columnIteration; i < z; i++) { 
 
\t $('tr').each(function() { 
 
\t \t var rowIterated = []; 
 
\t \t var columnHeader = $('tr:eq(0)').find($('td').eq(i)).text(); 
 
\t \t var xTD = $(this).find($('td').eq(i)).not($('td.nonX')); 
 
\t \t rowIterated.push(columnHeader); 
 
\t \t rowIterated.push(xTD); 
 
\t \t corespondingTD.push(rowIterated); 
 
\t }); 
 
}
table { 
 
    border: solid 1px #000; 
 
    border-collapse: collapse; 
 
} 
 

 
td { 
 
    border: solid 1px #000; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
 
<table> 
 
    <tbody> 
 
     <tr> 
 
      <td></td> 
 
      <td>WILLOW ADD-ON 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$6.99</td> 
 
      <td>TV ASIA<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$9.99</td> 
 
      <td>ZEE TV &amp; STAR INDIA PLUS 2-Pack<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
 
    </span>$14.99</td> 
 
      <td>SET ASIA &amp; STAR INDIA PLUS 2-Pack<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
 
    </span>$14.99</td> 
 
      <td>Hindi 4-Pack 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$24.99</td> 
 
      <td>Hindi 4-Pack 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$24.99</td> 
 
      <td>Hindi 4-Pack 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$24.99</td> 
 
      <td>Desi 4-Pack<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$29.99</td> 
 
      <td>Hindi 8-Pack 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$34.99</td> 
 
      <td>Desi Mega Pack: SET, TV Asia, Zee, Star Plus, Life OK, ABP News, Star Gold 
 
       <br> $42.99 
 
      </td> 
 
      <td>Hindi 12-Pack 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$44.99</td> 
 
      <td>Tamil 2-Pack 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp; </span>$14.99</td> 
 
      <td>Punjabi 2-Pack 
 
       <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$14.99</td> 
 
     </tr> 
 
     <tr> 
 
      <td>ABP NEWS</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>AAPKA COLORS</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>EROS NOW: VIDEO ON DEMAND <font class="font5">($9.99/mo. Add-On)</font></td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>LIFE OK</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>NDTV 24x7</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>NDTV GOOD TIMES 
 
      </td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>SAB</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>SONY MIX</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>STAR INDIA PLUS 
 
       <span style="mso-spacerun:yes">&nbsp;</span></td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>STAR INDIA GOLD 
 
      </td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>SET ASIA</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>TV ASIA</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>ZEE BOLLYWOOD</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>ZEE TV</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>WILLOW</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>VIJAY</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>SUN TV</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
      <td>&nbsp;</td> 
 
     </tr> 
 
     <tr> 
 
      <td>JUS PUNJABI</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
     </tr> 
 
     <tr> 
 
      <td>TV84</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>&nbsp;</td> 
 
      <td>x</td> 
 
     </tr> 
 
     <!--EndFragment--> 
 
    </tbody> 
 
</table>

答えて

1

対応する行の列の値とXによって識別されたカラムヘッダに対応するプロパティを含むオブジェクトを作成する単純なテーブルを持つ最小の例でありますヘッダー。それはXのために行と列のヘッダー値を割り出して、あなたがコードで何が起こっているかを見ることができるように私はそこにいくつかのログ行を左:あなたのテーブルで

var lists = {}; 
 

 
buildLists(); 
 

 
console.log(JSON.stringify(lists, null, 2)); 
 

 
function buildLists() { 
 
    $('#data tbody tr td').each(function() { 
 
    var columnIndex = $(this).parent().children().index($(this)); 
 
    var rowIndex = $(this).parent().parent().children().index($(this).parent()); 
 
    if ($(this).html() == 'x') { 
 
     var columnHeader = getTableCellValue('data', 0, columnIndex); 
 
     var rowHeader = getTableCellValue('data', rowIndex, 0); 
 

 
     //console.log('hit at ' + rowIndex + ' ' + columnIndex); 
 
     //console.log(getTableCellValue('data', rowIndex, columnIndex)); 
 
     //console.log(columnHeader + ' : ' + rowHeader); 
 

 
     if (!lists[columnHeader]) { 
 
     lists[columnHeader] = []; 
 
     } 
 
     lists[columnHeader].push(rowHeader); 
 

 
    }; 
 
    }); 
 
}; 
 

 
function getTableCellValue(tableId, rowIndex, columnIndex) { 
 
    var cell = $('#' + tableId + ' tr').eq(rowIndex).find('td').eq(columnIndex) 
 
    return cell.text(); 
 
}
table { 
 
    border: solid 1px #000; 
 
    border-collapse: collapse; 
 
} 
 

 
td { 
 
    border: solid 1px #000; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
 
<body> 
 
    <table id="data"> 
 
    <tbody> 
 
     <tr> 
 
     <td></td> 
 
     <td>foo</td> 
 
     <td>bar</td> 
 
     <td>baz</td> 
 
     </tr> 
 
     <tr> 
 
     <td>A</td> 
 
     <td>x</td> 
 
     <td></td> 
 
     <td></td> 
 
     </tr> 
 
     <tr> 
 
     <td>B</td> 
 
     <td>x</td> 
 
     <td></td> 
 
     <td>x</td> 
 
     </tr> 
 
     <tr> 
 
     <td>C</td> 
 
     <td></td> 
 
     <td>x</td> 
 
     <td>x</td> 
 
     </tr> 
 
    </tbody> 
 
    </table> 
 
</body>

(ました私は、それはまだ動作しますが、私はあなたが少し少ない冗長あなたのオブジェクトのプロパティ名を取得するために溶液を少しいじる必要があると思う)id="data"を与えた:

var lists = {}; 
 

 
buildLists(); 
 

 
console.log(JSON.stringify(lists, null, 2)); 
 

 
function buildLists() { 
 
    $('#data tbody tr td').each(function() { 
 
    var columnIndex = $(this).parent().children().index($(this)); 
 
    var rowIndex = $(this).parent().parent().children().index($(this).parent()); 
 
    if ($(this).html() == 'x') { 
 
     var columnHeader = getTableCellValue('data', 0, columnIndex); 
 
     var rowHeader = getTableCellValue('data', rowIndex, 0); 
 

 
     //console.log('hit at ' + rowIndex + ' ' + columnIndex); 
 
     //console.log(getTableCellValue('data', rowIndex, columnIndex)); 
 
     //console.log(columnHeader + ' : ' + rowHeader); 
 

 
     if (!lists[columnHeader]) { 
 
     lists[columnHeader] = []; 
 
     } 
 
     lists[columnHeader].push(rowHeader); 
 

 
    }; 
 
    }); 
 
}; 
 

 
function getTableCellValue(tableId, rowIndex, columnIndex) { 
 
    var cell = $('#' + tableId + ' tr').eq(rowIndex).find('td').eq(columnIndex) 
 
    return cell.text(); 
 
}
table { 
 
    border: solid 1px #000; 
 
    border-collapse: collapse; 
 
} 
 

 
td { 
 
    border: solid 1px #000; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
 
<body> 
 
    <table id="data"> 
 
     <tbody> 
 
      <tr> 
 
       <td></td> 
 
       <td>WILLOW ADD-ON 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$6.99</td> 
 
       <td>TV ASIA<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$9.99</td> 
 
       <td>ZEE TV &amp; STAR INDIA PLUS 2-Pack<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
 
    </span>$14.99</td> 
 
       <td>SET ASIA &amp; STAR INDIA PLUS 2-Pack<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
 
    </span>$14.99</td> 
 
       <td>Hindi 4-Pack 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$24.99</td> 
 
       <td>Hindi 4-Pack 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$24.99</td> 
 
       <td>Hindi 4-Pack 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$24.99</td> 
 
       <td>Desi 4-Pack<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$29.99</td> 
 
       <td>Hindi 8-Pack 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$34.99</td> 
 
       <td>Desi Mega Pack: SET, TV Asia, Zee, Star Plus, Life OK, ABP News, Star Gold 
 
        <br> $42.99 
 
       </td> 
 
       <td>Hindi 12-Pack 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$44.99</td> 
 
       <td>Tamil 2-Pack 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp; </span>$14.99</td> 
 
       <td>Punjabi 2-Pack 
 
        <span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$14.99</td> 
 
      </tr> 
 
      <tr> 
 
       <td>ABP NEWS</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>AAPKA COLORS</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>EROS NOW: VIDEO ON DEMAND <font class="font5">($9.99/mo. Add-On)</font></td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>LIFE OK</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>NDTV 24x7</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>NDTV GOOD TIMES 
 
       </td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>SAB</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>SONY MIX</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>STAR INDIA PLUS 
 
        <span style="mso-spacerun:yes">&nbsp;</span></td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>STAR INDIA GOLD 
 
       </td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>SET ASIA</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>TV ASIA</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>ZEE BOLLYWOOD</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>ZEE TV</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>WILLOW</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>VIJAY</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>SUN TV</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
       <td>&nbsp;</td> 
 
      </tr> 
 
      <tr> 
 
       <td>JUS PUNJABI</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
      </tr> 
 
      <tr> 
 
       <td>TV84</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>&nbsp;</td> 
 
       <td>x</td> 
 
      </tr> 
 
      <!--EndFragment--> 
 
     </tbody> 
 
    </table> 
 
</body>

+0

これは大変です。それは私が必要としていたことを正確に行うことを可能にした。列見出しがあまりにも口にまするのはあなたが正しいことでした。一様に構築されていないJSONオブジェクトを動的に反復処理する方法は? –

関連する問題