PDA

View Full Version : Controlling Pics Inside A Table?!


djshongo
04-03-2009, 11:28 AM
Hi

I have a table with 2 rows and 3 columns..
6 pics are in the table.

Im wondering how i can control the pics inside the table in a mass way, like using CSS?

Say i wanted to centre all the images inside the table, or add a blue 2px border to all the pics inside the table..

How would i go about doing this?

Here is my code:

--------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="75%" border="1">
<tr>
<td><img src="file:///Z|/My%20Documents/temp/images/thumb-1.jpg" width="100" height="40"></td>
<td><img src="file:///Z|/My%20Documents/temp/images/thumb-1.jpg" width="100" height="40"></td>
<td><img src="file:///Z|/My%20Documents/temp/images/thumb-1.jpg" width="100" height="40"></td>
</tr>
<tr>
<td><img src="file:///Z|/My%20Documents/temp/images/thumb-1.jpg" width="100" height="40"></td>
<td><img src="file:///Z|/My%20Documents/temp/images/thumb-1.jpg" width="100" height="40"></td>
<td><img src="file:///Z|/My%20Documents/temp/images/thumb-1.jpg" width="100" height="40"></td>
</tr>
</table>
</body>
</html>
-------------------

Thanks in advance :)

J

d a v e
04-03-2009, 12:01 PM
something like this
td img {
border:2px solid blue;
}

will target any image within a table cell

djshongo
04-03-2009, 01:18 PM
stil no joy..

djshongo
04-03-2009, 02:15 PM
if i take out the IMG tag, the whole table gets a 2px blue border, but the images inside it stil dont..

any ideas?

d a v e
04-03-2009, 03:53 PM
post a url (preferably) or then the code so we can see what you have so far

mangofreak
04-03-2009, 04:22 PM
Try:
td {text-align:center;}
td img{border:2px solid blue;}

or
td img{border:2px solid blue;margin-left:auto; margin-right:auto;}

d a v e
04-03-2009, 04:56 PM
also do you have links on your images??

djshongo
04-06-2009, 12:10 PM
mangofreak - that works thanks :))

J

mangofreak
04-06-2009, 03:11 PM
Glad I could help.

d a v e
04-06-2009, 03:19 PM
i helped too! :(

:)

mangofreak
04-06-2009, 03:40 PM
that's true :)

djshongo
04-06-2009, 03:43 PM
sorry dave lol

thanks a lot :)

m1a2x3x7
04-06-2009, 06:54 PM
one tip...

this is not good. file:///Z|/My%20Documents/temp/images/thumb-1.jpg

should just be images/thumb-1.jpg.

djshongo
04-07-2009, 12:07 PM
thanks 'm1a2x3x7',

however this was just a test page that i created on my desktop here at work, hence the long and silly file name, if it was at home i would name it accordingly, i tend to get confused easily these days lol

cheers :)