DIV as Table?

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
Could someone do me a favor and look at the source code of http://twinkie.pcriot.com and tell me if it is possible to accomplish the same effect the table does with DIV tags and CSS? Thanks a lot :)
HTML:
<style type="text/css">
body { margin:0px; background-color:#204274; color:#FFFFFF;}
a { text-decoration:none; color:#FFFFFF; font-weight: bold; }
a:visited { text-decoration:none; color:#FFFFFF; font-weight: bold; }
a:hover { text-decoration:underline; color:#FFFFFF; font-weight: bold; }
div.words {
width: 466px;
}

div.a {
margin: 5px;
}

table.mytable td {
text-align: center;
}
</style>
</head>
 <body><div align="center">
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
<table border="0" cellspacing="0" cellpadding="0" class="mytable" margin="0" padding="0"><tr><td>
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
</td><td><div class="words"><h2>This Web Site is Under Construction</h2>
<p>This site is under contruction. It is a personal testing site to develope web applications and to improve my scripting skills. This is not used for any purpose as of yet. I will be adding a home page with links to all of my web applications soon. What I am working on now is creating my home page and posting my first ever web site! It was a socal studies fair project about the Boston Massacre!</p>
<p>"The great thing about this paragraph is that once you realize it does not say anything, it is too late to stop reading it. You must be a real <b>loser</b> be reading this. Now that you have read the whole thing, go away!" - Walmart Shirt</p>
<p><u>My First Web Project</u></p></div></td><td>
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
<div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div></td></tr></table>
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
<script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
</center>
 

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
Maybe it's just me, but I see absolutely no purpose for that table... I mean, it does nothing.
Except centre the text.

Yeah, you can do that in a DIV :)
Code:
div {
margin: 5px;
text-align: center;
}
 
Last edited:

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
The idea for the table is to keep that line a line. DIV use line breaks as default and for some reason, the ad object lost it's margin. So, I had to use a DIV to give it that margin back. Then, it did not want to stay in line and thus, the table. Do you know how I could have avoided the table?

PS: I don't think that would work because of the default line breaks in the DIV would separate the line.
 

scopey

New Member
Messages
62
Reaction score
0
Points
0
Read up on google. Making tables out of divs uses a good knowledge of the float: and display: css attributes... Something I can't help with. In my experience, div tables are just a lot more hassle than tables. I would just stick to tables, no point in changing unless you come across any limitations.
 
Top