JQueryを使用してHTMLを作成しようとしています。HTMLテーブルを作成するJQueryスクリプトがあります。
$('<table>').attr('cellspacing', '5').addClass('blocksTable')
.append('<tbody><tr><td>Name</td>')
.append('<td><input type="text" value="" name="textBlockNames" class="textField"/></td></tr>')
.append('<tr><td>Locale</td>')
.append('<td><input type="text" value="" name="textBlockLocales" class="textField"/></td></tr>')
.append('<tr><td>Content</td>')
.append('<td><input type="text" value="" name="textBlockContents" class="textField"/></td></tr></tbody>')
.append('</table>')
.appendTo($("#idParentBlocksTable"));
ただし、テーブルは次のように生成されます。
<table class="blocksTable" cellspacing="5">
<tbody>
<tr>
<td>Name</td>
</tr>
<tr>
<td>Locale</td>
</tr>
<tr>
<td>Content</td>
</tr>
</tbody>
<td>
<input class="textField" type="text" name="textBlockNames" value="">
</td>
<td>
<input class="textField" type="text" name="textBlockLocales" value="">
</td>
<td>
<input class="textField" type="text" name="textBlockContents" value="">
</td>
</table>
次のように生成する必要がありますが、次のようになります。
<table class="blocksTable" cellspacing="5">
<tbody>
<tr>
<td> Name </td>
<td>
<input class="textField" type="text" name="textBlockNames" value="">
</td>
</tr>
<tr>
<td> Locale </td>
<td>
<input class="textField" type="text" name="textBlockLocales" value="">
</td>
</tr>
<tr>
<td> Content </td>
<td>
<input class="textField" type="text" name="textBlockContents" value="">
</td>
</tr>
</tbody>
</table>
私がここで間違っていることは何ですか?問題をより明確に説明できるかどうかわからないので、システムで質問を送信できないため、ここに何かを入力しています。