tiamat2012
Programmer
Hi everyone,
I'm trying to convert a table into divs. to be EXACTLY the same. I'm using the Display: table property. Can anyone see why this isn't working?
original table:
css:
new table in divs:
Any help would be greatly appreciated.
I'm trying to convert a table into divs. to be EXACTLY the same. I'm using the Display: table property. Can anyone see why this isn't working?
original table:
Code:
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0" class="center" style="clear: both;">
<!--DWLayoutTable-->
<tr align="right">
<td height="39" colspan="2" valign="top"><a href="/database/index.php"><img src="/database/img/bomt_db_logo.gif" width="281" border="0" align="left" /></a></td>
<td colspan="5" valign="bottom"> <a href="view.php"><img src="/database/img/b_view.jpg" width="71" height="29" border="0" align="bottom" /></a><a href="updatemem.php"><img src="/database/img/b_update.jpg" width="71" height="29" border="0"></a><a href="addmem.php"><img src="/database/img/b_add.jpg" width="71" height="29" border="0"></a><a href="upload.php"><img src="/database/img/b_upload.jpg" width="111" height="29" border="0"></a></td>
</tr>
<tr valign="middle">
<td height="25" colspan="4" background="/database/img/title.jpg">
<span id="texttitle">Welcome!</span>
</td>
</tr>
</table>
css:
Code:
body {
width: 800px;
margin: 8px auto auto auto;
background-color: #AFD1D8;
font-family: arial, helvetica, sans-serif;
}
#texttitle {
margin-left: 16px;
font-weight: bold;
font-size: 16px;
color: white;
}
#path, #path a {
font-size: 10px;
color: white;
background-color: #999999;
text-decoration:none;
}
#main {
display: inline-table;
width: 100%;
}
#header {
display: table-row;
width: 100%;
text-align: right;
}
#logo {
display: table-cell;
height: 39px;
verticle-align: top;
}
#menu {
display: table-cell;
verticle-align: bottom;
}
#display {
display: table-row;
width: 100%;
verticle-align: middle;
}
#title {
width: 100%;
display: table-cell;
height: 25px;
background: url("img/title.jpg") repeat-x;
text-align: center;
}
div, a, img {
margin: 0;
padding: 0;
}
.center { text-align: center; }
.top { vertical-align: top; }
.middle { vertical-align: middle; }
.bottom { vertical-align: bottom; }
img { border-style: none; }
new table in divs:
Code:
<div id="main">
<div id="header">
<div id="logo">
<a href="/database/index.php"><img src="/database/img/bomt_db_logo.gif" width="281" border="0" align="left" />
</div>
<div id="menu">
<a href="view.php"><img src="/database/img/b_view.jpg" width="71" height="29" /></a>
<a href="updatemem.php"><img src="/database/img/b_update.jpg" width="71" height="29" /></a>
<a href="addmem.php"><img src="/database/img/b_add.jpg" width="71" height="29" /></a>
<a href="upload.php"><img src="/database/img/b_upload.jpg" width="111" height="29" /></a>
</div>
</div>
<div id="display">
<div id="title">
<span id="texttitle">Welcome to the Best of Montana Database!</span>
</div>
</div>
</div>
Any help would be greatly appreciated.