css - Can I create a HTML table width a percentage height but pixel accurate row heights? -


I need to create a table in a web page that has two lines, the table needs to fill the whole page, The stylesheet is set to 100% height and width and HTML and body height is set to 100%.

However, I need to properly fill the second line to fit the height of 100 pixels in the upper line of the table and the rest of the table. When I set the height of the top row, then it does not work

Is this behavior possible? I tried the following but it does not work.

  & lt; Table style = "border-fall: fall; height: 100%; width: 100%;" & Gt; & Lt; TR & gt; & Lt; Td style = "border: solid 1px black; height: 100px" & gt; 1 & lt; / Td> & Lt; Td style = "border: solid 1px black" & gt; 2 & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td style = "border: solid 1px black" & gt; 3 & lt; / Td> & Lt; Td style = "border: solid 1px black" & gt; 4 & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; Edit: I am using logical data and especially want to use a table, divs the above sample to simplify a table with approximately 20 columns. is. <2p> 

EDIT: I have found the problem. This is a functional definition in HTML (added by Visual Studio). After deletion ...

... if it works perfectly then my new question is, Is it OK or what to do with DOCTYPE Is there a right way?

This works without CSS:

  & Lt; Html & gt; & Lt; Body & gt; & Lt; Table height = "100%" width = "100%" range = "1" & gt; & Lt; Tr height = "100" & gt; & Lt; Td> This item is text. & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> This item text 2. & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

So it is possible, I will now try with CSS.


Comments