1 reply [Last post]
Hachaso
Offline
newbie
Last seen: 18 years 41 weeks ago
Joined: 2004-08-23
Posts: 5
Points: 0

Hi again!

I've asked around and someone told me that I could create a table and inside this table put my images so that they are in the center always, no matter what resolution the viewer has.

Well, can someone pleaes help me out how to create a table with CSS and to center it?
Also how I can put images inside of it or links?

Thanks

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 1 year 5 weeks ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

creating a table

Try this. I think it needs the html 4.0 doctype to work:

<table border="0" height="100%" width="100%">
<tbody> <tr valign="center"> <td align="center">

<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr valign="center">
<td align="center">
image here
</td>
</tr>
</tbody>
</table>

</td></tr></tbody></table>

The first table stretches the entire page, and is 1 column by 1 row, hopefully centred. The second table should stretch to the size of the image and center it. Try it.

Verschwindende wrote:
  • CSS doesn't make pies