Getting rid of those stupid tables...
Hello all...
So I decided to get with the times today and started using a CSS. So far, it seems pretty cool! But I hear everybody saying that tables aren't necessary for page placing.
In one of my pages, I have a table that is divided into three parts:
HTML Code:
<table>
<tr>
<td width="33%" > Part 1</td>
<td width="34%" > Part 2</td>
<td width="33%" > Part 3</td>
</tr>
</table>
Now I am wondering what sort of things I would need to do to get rid of the table, but maintain the three parts in their proper placing on the page.
Here is the page that I am trying to change if you guys need that... Thanks in advance!!!
Originally Posted by
goofy1989
Hello all...
So I decided to get with the times today and started using a CSS. So far, it seems pretty cool! But I hear everybody saying that tables aren't necessary for page placing.
In one of my pages, I have a table that is divided into three parts:
HTML Code:
<table>
<tr>
<td width="33%" > Part 1</td>
<td width="34%" > Part 2</td>
<td width="33%" > Part 3</td>
</tr>
</table>
Now I am wondering what sort of things I would need to do to get rid of the table, but maintain the three parts in their proper placing on the page.
Here is the page that I am trying to change if you guys need that... Thanks in advance!!!
Just set the border to zero.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>3 columns</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
//-->
</script>
<style type="text/css">
<!--
body, html {margin:0;padding:0;}
#left, #middle, #right {height:130px;}
#left {float:left;width:33%;background:red;}
#middle {width:100%; background:white;}
#right {float:right; width:33%; background:blue;}
-->
</style>
</head>
<body>
<div id="middle">
<div id="left">left</div>
<div id="right">right</div>
middle
</div>
</body>
</html>
At least 98% of internet users' DNA is identical to that of chimpanzees
Uggh tables within tables!
try this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Div Example</title>
<style type="text/css">
#mainframe{width:100%;}
#left{width:33%; background-color:#ff2; float:left;}
#right{width:33%;background-color:#fa4;float:right;}
#center{width:33%;background-color:#fd2; margin:auto;}
</style>
<meta name="Generator" content="TextPad 4.7">
<meta name="Author" content="Rincewind">
<meta name="Keywords" content="?">
<meta name="Description" content="?">
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body>
<div id="mainframe">
<div id="left">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p>
</div>
<div id="right">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p>
</div>
<div id="center">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p>
</div>
</div>
</body>
</html>
none of the above really worked. http://www.yahoodrummer.com/nate/topwithcss.asp is the site where I'm experimenting, and I've posted the original in the first post. What am I doing wrong?
and http://www.yahoodrummer.com/nate/topwithcss.asp is the post above my two. It doesn't line up correctly...
Last edited by goofy1989; 10-03-2005 at 10:49 PM .
Hi -
It helps to set a margin: on every element - and I floated all of the divs left.
Hope this works for you,
El
Code:
<style type="text/css">
body{
width:100%; margin:0; padding:0; height:100%; font-size:100%;
text-align:center; background:white none;}
div.contain{
width:100%; margin:0 auto; font-family:"verdana", "tahoma", sans-serif;
font-size:70%;}
.contain p{
padding:10px; width:80%; margin:0 auto; text-align:center;}
#left{width:33.3%; background-color:#ff2; float:left; margin:0 auto;}
#center{width:33.3%; background-color:#fd2; float:left; margin:0 auto;}
#right{width:33.3%; background-color:#fa4; float:left; margin:0 auto;}
</style>
<meta name="Generator" content="TextPad 4.7">
<meta name="Author" content="Rincewind">
<meta name="Keywords" content="?">
<meta name="Description" content="?">
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body>
<div class="contain">
<div id="left">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p>
</div>
<div id="right">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p>
</div>
<div id="center">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p>
</div>
</div>
</body>
</html>
Thank for all the help, but it still looks funky. Look at the test page to see what I mean...
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks