Correct thead and tbody for a table structure?
Hello, until recently I have always written a html table like this:
Table Example 1a
HTML Code:
<table summary="an example of writing a table">
<tr>
<th scope="col">Table Header 1</th>
<th scope="col">Table Header 2</th>
<th scope="col">Table Header 3</th>
</tr>
<tr>
<td>Table Data 1</td>
<td>Table Data 1</td>
<td>Table Data 1</td>
</tr>
<table>
Table Example 2a
HTML Code:
<table summary="an example of writing a table">
<tr>
<th scope="row">Table Header 1</th>
<td>Table Data 1</td>
<th scope="row">Table Header 2</th>
<td>Table Data 1</td>
<th scope="row">Table Header 3</th>
<td>Table Data 1</td>
</tr>
<table>
But I while creating a JavaScript program, I have descovered that if I want to dynamically add a table in IE then the table needs a tbody or IE JavaScript refuses to add the table dynamically, so I am now trying to think how to use thead and tbody correctly.
For example 1a it seems pretty easy:
Table Example 1b
HTML Code:
<table summary="an example of writing a table">
<thead>
<tr>
<th scope="col">Table Header 1</th>
<th scope="col">Table Header 2</th>
<th scope="col">Table Header 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Table Data 1</td>
<td>Table Data 1</td>
<td>Table Data 1</td>
</tr>
</tbody>
<table>
But I dont know how you would do Table Example 2a ?
Table Example 2b
HTML Code:
<!-- ???? :-S ???? -->
Thanks
ro0bear :D