I need to create a table in a web page that has two rows. The table needs to fill the entire page so I have set the height and width of the table to 100% in the CSS stylesheet and the height of the html and body to 100% too.
However, I need to top row of the table to be exactly 100 pixels in height and the second row to expand to fit the remainder of the table. When I set the height of the top row, it doesn't work.
Is this behaviour possible? I tried the following but it doesn't work.
<table style="border-collapse:collapse;height:100%;width:100%;">
<tr>
<td style="border:solid 1px black;height:100px">1</td>
<td style="border:solid 1px black">2</td>
</tr>
<tr>
<td style="border:solid 1px black">3</td>
<td style="border:solid 1px black">4</td>
</tr>
</table>
Edit: I am using tabular data and specifically want to use a table, not divs. The sample above is to simplify a table with around 20 columns.
Edit 2: I have found the issue. It is the doctype definition in the HTML (added by Visual Studio). After removing...
...it works perfectly. So my new question is, is this OK to do or is there a correct way to do it with the DOCTYPE?