Table into DIV

windows

Guest
HI there.

I have this simple table code and I've been told that it's better to do while using DIV so the search engines can read it better.

I'm not sure how to get that simple table effect with CSS > DIV... can someone help me with that?


<table cellpadding="0" cellspacing="0" border="0" width="660" bgcolor="#e86d1b">
<tr>
<td align="center" height="18" style="color: #ffffff; font-size: 11px; padding-left: 18px;">All Rights Reserved.</td>
</tr>
</table>


Thanks!Oooo, no need for that thar table.
This will do:

<style type="text/css">
/*<![CDATA[*/
.reserved {
width: 660px;
height: 18px;
line-height: 18px;
font-size: 11px;
text-align: center;
background-color: #e86d1b;
}
/*]]>*/
</style>

Note, no special reason I used a class; as long as it's only used once, an ID is fine.

<p class="reserved">All Rights Reserved.</p>this what your looking for?
put in a css file(or style tags in head)

#Divname
{
poistion:absolute;
width:660px;
height:18px;
padding-left:18px;
background-color:#e86d1b;
text-align:center;
font-size:11px;
color: #ffffff;
}


then add this in the body

<div id="Divname">
All rights Reserved
</div>


this is much better for search engines. just saying, if your site is using alot of tables, you will have problems. so get used to CSS:) hope this helped.:p 1 minute difference...lolmake the text to be in the middle of the DIV (like a valign kind of thing)?this part of the css text-align:center; should do that.The text is stil stuck in the top...

here's the code:

#copyright
{
poistion: absolute;
width: 660px;
height: 40px;
background-color: #e86d1b;
text-align: center;
font-size: 11px;
color: #ffffff;
}vertical-align: middle;

but someone on another thread was saying that this isnt well supported and suggested using line-height: <length>; insteadvertical-align applies to inline-level and table-cell elements, so you'd probably be better off using line-height, setting it to the height of the element -- in this case, 40px.
 
Back
Top