megabobik megabobik - 3 months ago 22
HTML Question

Html table withsubsections

I want to create table with main section and subsections like thattarget table

I tried

<html>
<body>
<table style="width:100%">
<tr>
<td rowspan="3">section</td>
<td rowspan="3">subsection1</td>
<td rowspan="2">subsection1</td>
<td rowspan="1">subsection1</td>
</tr>
<tr>
<td>text1</td>
</tr>
<tr>
<td>text2</td>
</tr>
<tr>
<td>text3</td>
</tr>
...
</table>
</body>
</html>


but this code dont create dont create subsections. Surrounding subsection1 with also dont create subsections.enter image description here

Answer
<html> 
<body>
<table style="width:100%">
<tr>
   <td rowspan="6">section</td>
   <td rowspan="3">subsection1</td>
   <td>text1</td>
</tr>
<tr>
   <td>text2</td>
</tr>
<tr>
   <td>text3</td>
</tr>
<tr>
   <td rowspan="2">subsection2</td>
   <td>...</td>
</tr>
<tr>
     <td>...</td>
</tr>
<tr>
    <td rowspan="1">subsection3</td>
    <td>...</td>
</tr>
</table>
</body>
</html>

See this JSFiddle

Comments