Hi,
I have 3 divs of same height (10% of parent element) placed horizontally and all of them looks of same height and at same offset from parent element but
when I placed a table within 1st div, the other two divs moves little bit downward.
I am not able to find out, Code is belwe, Please help.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<style>
.portlet {
font-family:trebuchet ms;
border: solid gray 1px;
display: inline;
text-align: left;
margin: 1%;
}
.portlet div.heading {
background-color:orange;
color:black;
font-size: x-small;
font-weight: bold;
padding-left: 5px;
}
.portlet div.data {
overflow: auto;
border: 0px solid black;
padding: 3px;
font-size: x-small;
}
</style>
<script language="JavaScript">
<!--
function showTable() {
document.getElementById("my_table").innerHTML =
'<table cellspacing="0" width=100% border=1>'
+ '<tr style="background-color:orange;color:black; font-family: \'Trebuchet MS\'; font-size: x-small">'
+ ' <th colspan="2" style="padding: 0px;">M_Head_1</th>'
+ ' <th colspan="2" style="padding: 0px;">M_Head_2</th>'
+ ' </tr>'
+' <tr style="font-family: \'Trebuchet MS\'; font-size: x-small">'
+ '<td>Head_1</td>'
+ '<td>Head_2</td>'
+ ' <td>Head_3</td>'
+ ' <td>Head_4</td>'
+ ' </tr>'
+' <tr style="font-family: \'Trebuchet MS\'; font-size: x-small">'
+' <td>772</td>'
+' <td>512</td>'
+' <td>8</td>'
+' <td>2</td>'
+' </tr>'
+' </table>';
}
//-->
</script>
</head>
<body>
<div style="border: 0px; width:984px; height: 680px; font-family: 'Trebuchet MS'; font-size: x-small;">
<div class="portlet" style="width: 35%; height: 10%;" id="my_table">
</div>
<div class="portlet" style="width: 28%; height: 10%;">
<div class="heading">Box 2 Heading</div>
<div class="data" style="height: 70%;">
</div>
</div>
<div class="portlet" style="width: 28%; height: 10%;">
<div class="heading">Box 3 Heading</div>
<div class="data" style="height: 70%;">
</div>
</div>
<input type="button" value="Show Table" onclick="showTable()">
</div>
</body>
</html>