In Internet Explorer, I am viewing an HTML table, which has another table in it.
This was my code earlier:
But then I needed to underline the heading starting from Item Name up to Amount. I created an inner table and the code is as follows:
This works OK and I get an underline effect from Item Name up to Amount.
But I need to know how the widths are being calculated correctly?
In the first code fragment, outer table width was 86%, and five cells say c1,c2,c3,c4,c5 have 14%,51%,7%,7%,7%.
But then there is another table from c2 to c5. Sum of widths from c2 to c5 is 72% for outer table. The inner table has width 100% and inner table cells have widths (51+7+7+7=72%). Inner table sum of widths is not equal to 100%. Instead it is equal to outer table sum of widths from c2 to c5.
But still the browser is displaying the results correctly??
This was my code earlier:
Code:
Response.Write "<table border=0 width='86%' cellpadding=0 cellspacing=0>"
Response.Write "<tr><td width='14%'> </td>"
Response.Write "<tr><td width='51%'>Item Name</td>"
Response.Write "<td width='7%' align='right'>Qty</td>"
Response.Write "<td width='7%' align='right'>Price</td>"
Response.Write "<td width='7%' align='right'>Amount</td></tr>"
Response.Write "</table>"
But then I needed to underline the heading starting from Item Name up to Amount. I created an inner table and the code is as follows:
Code:
Response.Write "<table border=0 width='86%' cellpadding=0 cellspacing=0>"
Response.Write "<tr><td width='14%'> </td>"
Response.Write "<td width='72%'><table width='100%' border=0 cellpadding=0 cellspacing=0 style='border-bottom:1px dashed black'>"
Response.Write "<tr><td width='51%'>Item Name</td>"
Response.Write "<td width='7%' align='right'>Qty</td>"
Response.Write "<td width='7%' align='right'>Price</td>"
Response.Write "<td width='7%' align='right'>Amount</td></tr></table></td></tr>"
Response.Write "</table>"
This works OK and I get an underline effect from Item Name up to Amount.
But I need to know how the widths are being calculated correctly?
In the first code fragment, outer table width was 86%, and five cells say c1,c2,c3,c4,c5 have 14%,51%,7%,7%,7%.
But then there is another table from c2 to c5. Sum of widths from c2 to c5 is 72% for outer table. The inner table has width 100% and inner table cells have widths (51+7+7+7=72%). Inner table sum of widths is not equal to 100%. Instead it is equal to outer table sum of widths from c2 to c5.
But still the browser is displaying the results correctly??