473,473 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CSS q, laying out some images in a table/<td> relative to upper corner of cell.

Trying to line up a tic-tac-toe board type grid of images using style=
tags to <img inside a table TD
but it's not working, I get more like a set of steps, can I get an
explanation of what's wrong with this and how to do it correctly?:

<table border="1">
<tr>

<td valign="top" align="left">

<!-- following should line up as a grid, look like a staircase -->
<img src=here.gif style="{position:relative;top:6px;left:36px;}">
<img src=here.gif style="{position:relative;top:6px;left:139px;}">
<img src=here.gif style="{position:relative;top:6px;left:242px;}">
<img src=here.gif style="{position:relative;top:87px;left:36px;}">
<img src=here.gif style="{position:relative;top:87px;left:139px;}">
<img src=here.gif style="{position:relative;top:87px;left:242px;}">
<img src=here.gif style="{position:relative;top:168px;left:36px;}">
<img src=here.gif style="{position:relative;top:168px;left:139px;}">
<img src=here.gif style="{position:relative;top:168px;left:242px;}">

</td>
</tr>
</table>
For this example it's a grid but I have 7 other patterns I have to lay
up with this not all of them can be expressed with a grid pattern.

any help is appreciated.

Jul 19 '06 #1
4 4051
Els
dr**********@gmail.com wrote:
<!-- following should line up as a grid, look like a staircase -->
<img src=here.gif style="{position:relative;top:6px;left:36px;}">
<img src=here.gif style="{position:relative;top:6px;left:139px;}">
[snip]

a) Take out the {} from the style attribute.
b) Add " around the value of the src attribute.
c) Add alt="" to every img tag, or fill in an appropriate alternative
text, like alt="picture of the moon".
d) You don't want to use position:relative for this.
Perhaps position:absolute? Depends on what you want. If you don't give
any style at all, they may already line up like you want.
For this example it's a grid but I have 7 other patterns I have to lay
up with this not all of them can be expressed with a grid pattern.
Depending on the patterns, you may need position:absolute for that.
To position them relative to the border of the td, give the td
position:relative, and each image position:absolute.
any help is appreciated.
You're welcome.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: The Clash - Louie Louie
Jul 19 '06 #2
Els wrote:

....
For this example it's a grid but I have 7 other patterns I have to lay
up with this not all of them can be expressed with a grid pattern.

Depending on the patterns, you may need position:absolute for that.
To position them relative to the border of the td, give the td
position:relative, and each image position:absolute.
interestingly (kidding) this works with IE and not Mozilla, Opera, etc
if I made the <td style="position:absolute;"it seems ok but only if I
have 1 <td>

if I try to put 2 <td>s like this in one <tr(or 2 <tr>s with 1 <tb>
in each) like this they are totally stacked on top of one another.

I can not use :absolute on it's own (outside tables) as when the window
is resized the items are no longer in the table. entire page is in
<centertags now this all worked before when it was just left-weighted
(no <center>)

I might have to completely scrap this and start from scratch

thanks
Now playing: The Clash - Louie Louie
I didn't realize the Clash did a version of Louie Louie

Jul 20 '06 #3
Els
dr**********@gmail.com wrote:
Els wrote:

...
>>For this example it's a grid but I have 7 other patterns I have to lay
up with this not all of them can be expressed with a grid pattern.

Depending on the patterns, you may need position:absolute for that.
To position them relative to the border of the td, give the td
position:relative, and each image position:absolute.

interestingly (kidding) this works with IE and not Mozilla, Opera, etc
if I made the <td style="position:absolute;"it seems ok but only if I
have 1 <td>

if I try to put 2 <td>s like this in one <tr(or 2 <tr>s with 1 <tb>
in each) like this they are totally stacked on top of one another.
No, if you give both <td>s position:relative (not absolute!), then the
contents of each should stay inside of it.
I can not use :absolute on it's own (outside tables) as when the window
is resized the items are no longer in the table. entire page is in
<centertags now this all worked before when it was just left-weighted
(no <center>)
It would work if you gave the container that's around the lot (the
most outer element that gets centered), position:relative.

If none of the elements has position, the viewport is what all the
absolute positioned elements are getting their position from. Which is
why the page can move to the right (when making the window wider),
while the elements that you gave position:absolute, stay put.
I might have to completely scrap this and start from scratch
You might wanna show a url so we can more clearly point out what could
be the solution :-)
>Now playing: The Clash - Louie Louie

I didn't realize the Clash did a version of Louie Louie
You learn something new everyday ;-)

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Jul 20 '06 #4

Els wrote:

[sniiiiip]
You might wanna show a url so we can more clearly point out what could
be the solution :-)
I would have if I could but the page in question was for a site that
isn't public yet and only available on an internal network. I couldn't
duplicate it outside the network as I only have apache servers and this
was an IIS/ASP page and even if I could, I am forbidden to.

HOWEVER I got this working, eventually, a completely different way*, so
all worked out in the end.

Thank you for your help.

* using walter zorn's drag drop js and hacking in a few lines.

>
Now playing: The Clash - Louie Louie
I didn't realize the Clash did a version of Louie Louie

You learn something new everyday ;-)

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Jul 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: A Web Master | last post by:
As a mean of not having to use Framesets/Frames with all the bad side effects/workarounds that come with them, I want to know if it is possible to code a scrolling veritcal bar into a table <TD> ?...
1
by: christian9997 | last post by:
Hi I was trying to create a page where a SubMenu would appear when the user moved the mouse over an item of a Menu (= Table Cell <TD>). Unfortunately there seems to be a problem; the onMouseOver...
5
by: MyndPhlyp | last post by:
I've been busting my head trying to figure this out for quite some time. With IE6 and NS7, no problems. I can simply code the HTML <img height="100%"> and be done with it. But NS4 and NS6 (and...
14
by: Zenobia | last post by:
Hello folks, Is it possible to position an item within a <td> element? For instance see below. The table has multiple rows, one for each database record. Each row has 3 hrefs associated with it...
2
by: Pete Kipe | last post by:
I'm not a JavaScript programmer...but I'm trying to put together a simple menu system for a new website and need a little help. I have the following script: <SCRIPT language=javascript> <!--...
1
by: prefersgolfing | last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML page within a <table><tr><td> on a .aspx. I have a lengthy guide already paginated in html. I'd like to embed the...
4
by: Jason | last post by:
Is that possible? How? <td > <asp:Label ID="StartDateLabel" runat="server" Text="Start Date:"> <asp:imagebutton ID="Imagebutton1" width=18 Height=18 CommandName=SetDate imageUrl="../cal.jpg"...
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
2
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.