table cell spacing

B

bbxrider

this is the page i'm working on
http://1614-douglas-road.com/spectrum.html

i want to get the generous space between the images in the table preferably
without borders
so i have been using cellpadding and/or cellspacing
the picture titles can be 2 lines, 'hammered small', so they seem to need
their own row to be
centered under the pic and the same padding/spacing as the row with the
images, so they line up

what i'm trying to do is have similar spacing to the way the page goes now,
but get the pic titles
closer to the actual pics

have tried all kinds of colspan, &nbsp, separate tables for each row, etc
but getting nowhere fast

also not sure why table is not centering on page

any suggestions would be appreciated
bob
 
S

SigelsTankMage

you can use this code for centering with css

body {
margin:50px 0px; padding:0px;
text-align:center;
}

#Content {
width:500px;
margin:0px auto;
text-align:left;
padding:15px;
border:1px dashed #333;
background-color:#eee;
}
(source:http://bluerobot.com/web/css/center1.html)

and have you tried using padding yet?
 
S

SigelsTankMage

this took me less than five minutes so i went the extra mile. i used
code from blue robot and css listamatic since i thought it would be
better if you used lists for the images you had.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div id="content">
<div id="navcontainer">
<ul id="navlist">
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
</ul>
<br />
<ul id="navlist">
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
</ul>
</div>
</div>
</body>
</html>

body {
margin:50px 0px; padding:0px;
text-align:center;
}

#Content {
width:500px;
margin:0px auto;
text-align:left;
padding:15px;
border:1px dashed #333;
background-color:#eee;
}

ul#navlist
{
margin-left: 0;
padding-left: 0;
white-space: nowrap;
}

#navlist li
{
display: inline;
list-style-type: none;
}

#navlist a { padding: 3px 10px; }

#navlist a:link, #navlist a:visited
{
color: #fff;
background-color: #036;
text-decoration: none;
}

#navlist a:hover
{
color: #fff;
background-color: #369;
text-decoration: none;
}

ul>li{
padding:0 0 0 100px;
}
 
B

bbxrider

wow wish i was that fast,
thought about lists but obviously never got that far
will try all this soon and post back, with results
thanks
bob
 
J

John Hosking

(e-mail address removed) wrote:

[without quoting of the message he's replying to...]
this took me less than five minutes so i went the extra mile.

How does boasting about the small amount of time you spent demonstrate
that you made any "extra" effort? Or is this some droll humor?
i used
code from blue robot and css listamatic since i thought it would be
better if you used lists for the images you had.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML is pointless. Stay with HTML 4.01, but use strict:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" />

If you're going to pretend to provide the complete source, include the
</head>
<body>
<div id="content">
<div id="navcontainer">

Not sure what makes this array of images a "nav" element.
<ul id="navlist">
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>

All of the instances of heigh will need to become height.
</ul>
<br />
<ul id="navlist">

Only one instance of an id per page, please. OP will need to validate
all this code before spending much time with it. Might even have to
spend *six* minutes on it. ;-)
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
<li><img src="img/40.jpg" width="40" heigh="40" /></li>
</ul>
</div>
</div>
</body>
</html>

body {
margin:50px 0px; padding:0px;
text-align:center;
}

#Content {

Watch for case mismatch with "content".
width:500px;
margin:0px auto;
text-align:left;

But you just gave body text-align:center.
padding:15px;
border:1px dashed #333;
background-color:#eee;
}
[...]
#navlist a { padding: 3px 10px; }

#navlist a:link, #navlist a:visited
{
color: #fff;
background-color: #036;
text-decoration: none;
}

#navlist a:hover

{
color: #fff;
background-color: #369;
text-decoration: none;
}

ul>li{

padding:0 0 0 100px;
}

This code doesn't do the enlarge-on-hover trick I presumed the OP
wanted, nor does it demonstrate captioned images in a grid.

Etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top