Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-01-2010, 07:34 AM   PM User | #1
metathirteen
New Coder

 
Join Date: Jan 2010
Posts: 76
Thanks: 3
Thanked 0 Times in 0 Posts
metathirteen is an unknown quantity at this point
table troubles

im making a site for myself and im still pretty new to this stuff. im trying to give it like a dos sorta look. right now im using tables for these boxes i made but i cant figure out how to change the spacing for when i type in them. it always just comes up in the middle of the table.

can anyone help me out?
heres a link to my site. see how navi box is in the middle?
http://switcharoo.agilityhoster.com/dossite.html
metathirteen is offline   Reply With Quote
Old 01-01-2010, 07:47 AM   PM User | #2
cyborg360
Regular Coder

 
Join Date: Nov 2009
Posts: 202
Thanks: 25
Thanked 0 Times in 0 Posts
cyborg360 is an unknown quantity at this point
Quote:
Originally Posted by metathirteen View Post
im making a site for myself and im still pretty new to this stuff. im trying to give it like a dos sorta look. right now im using tables for these boxes i made but i cant figure out how to change the spacing for when i type in them. it always just comes up in the middle of the table.

can anyone help me out?
heres a link to my site. see how navi box is in the middle?
http://switcharoo.agilityhoster.com/dossite.html
Here are a couple things you can do below. Others may have better ideas for achieving the same results.

One thing you can do is add a paragraph as in this code below (the "<p>" is a symbol for paragraph):

Code:
  <TR>
    <TD height="118" bgcolor="#0000CC">&nbsp;</TD>
    <TD bgcolor="#0000CC">
	<p align="right">navi box</p></TD>
    <TD bgcolor="#000000">&nbsp;</TD>
  </TR>
I've aligned the text to the right.

Another thing you can do now is align it to the top of that table. This is how you'd do it in expression web 3:
1. right click the <p> box on your display
2. click cell properties.
3. go to "vertical alignment" and select top.

The code for both these operations looks like this:

Code:
 <TR>
    <TD height="118" bgcolor="#0000CC">&nbsp;</TD>
    <TD bgcolor="#0000CC" valign="top">
	<p align="right" height: 13px;">navi box</FONT></TD>
    <TD bgcolor="#000000">&nbsp;</TD>
  </TR>
Another way you can do it which may be more complicated in the short run but I think more people will recommend for better results in the long run is to use the CSS property text-align.

Last edited by cyborg360; 01-01-2010 at 08:22 AM..
cyborg360 is offline   Reply With Quote
Old 01-01-2010, 08:33 AM   PM User | #3
metathirteen
New Coder

 
Join Date: Jan 2010
Posts: 76
Thanks: 3
Thanked 0 Times in 0 Posts
metathirteen is an unknown quantity at this point
thanks a bunch, guy =D
i knew there was a way to do it but i couldnt remember lol. drove me nuts
metathirteen is offline   Reply With Quote
Old 01-01-2010, 08:36 AM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Hi there,

Don't you know why using tables for layout is very bad?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 01-01-2010, 05:03 PM   PM User | #5
metathirteen
New Coder

 
Join Date: Jan 2010
Posts: 76
Thanks: 3
Thanked 0 Times in 0 Posts
metathirteen is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
Hi there,

Don't you know why using tables for layout is very bad?
i tried using css to do make the 3d boxes but i couldnt figure it out.
i have no idea how else to do it
is there an easier/better way?

Last edited by metathirteen; 01-01-2010 at 05:19 PM..
metathirteen is offline   Reply With Quote
Old 01-01-2010, 05:12 PM   PM User | #6
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Quote:
Originally Posted by metathirteen View Post
i have no idea how else to do it
is there an easier/better way?
That website that ab linked you to is not just about condeming tables. It also goes into some detail about the more modern methods of web building.
Did you read it?

Another link about tables in my sig below.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 01-01-2010, 05:44 PM   PM User | #7
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Here's a start metathirteen, still needs the drop shadow applied but it's a start.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
	font: 100% "Comic Sans MS";
	background: #000;
	color: #FFF;
}
* {
	margin: 0;
	padding: 0;
	border: 0;
}
#container {
	height: 560px;
	width: 760px;
	margin: 30px auto;
	padding: 20px;
	background: url(http://switcharoo.agilityhoster.com/bg.jpg);
	font-size: 0.8em;
}
#navbox {
	width: 177px;
	float: left;
	padding: 10px;
	background: #00f;
	list-style: none;
}
	#navbox li {
	width: 177px;
	text-align: center;
	line-height: 20px;
	}
		#navbox li a {
			text-decoration: none;
			display: block;
		}
		#navbox li a:hover {color: #f00;}
#contentbox {
	margin: 0 0 0 240px;
	background: #00f;
}
</style>
</head>
<body>
    <div id="container">
        	<ul id="navbox">
                <li><a href="#">link one</a></li>
                <li><a href="#">link two</a></li>
                <li><a href="#">link three</a></li>
                <li><a href="#">link four</a></li>
                <li><a href="#">link five</a></li>
                <li><a href="#">link six</a></li>
                <li><a href="#">link seven</a></li>
            </ul>
        <div id="contentbox">
            <p>
                Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
            </p>
            <p>
                Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
            </p>
        <!--end contentbox--></div>
    <!--end container--></div>
</body>
</html>
See a demo I have on a simple drop shadow here.


...
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 01-06-2010, 05:09 AM   PM User | #8
metathirteen
New Coder

 
Join Date: Jan 2010
Posts: 76
Thanks: 3
Thanked 0 Times in 0 Posts
metathirteen is an unknown quantity at this point
awesome thanks a bunch
im starting to understand this stuff a little better =D
metathirteen is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:31 PM.


Advertisement
Log in to turn off these ads.