Solved

How to overlap an image over a table?

Posted on 2016-09-01
7
41 Views
Last Modified: 2016-09-01
Hi there, was just wondering if.. you can overlap an image over a table?

<table border=0 cellpadding=0 cellspacing=0 width=1330 height=220 align=center bordercolor=black>
	<tr>
		<td height=190 width=55>&nbsp;</td>
		<td height=240 width=200 rowspan=2 valign=middle><a href=?><img src=http://www.activenquiry.info/images/brand-GPT.png height=200></a></td>
		<td height=190 width=55>&nbsp;</td>
		<td height=190 width=720>&nbsp;</td>
		<td height=190 width=300 valign=middle>
			<table width=300>
				<tr>
					<td align=right class=menu><b><font size=3>Good morning Traveller</font></b></td>
				</tr>
				<tr>
					<td align=right><font size=2><a href=http://customer.gptouring.com.au class=menu>Log in to GP Touring Portal</a></font></td>
				</tr>
			</table>
		</td>
		<td height=190 width=20>&nbsp;</td>
	</tr>
	<tr>
		<td height=50 bgcolor=black>&nbsp;</td>
		<td height=50 bgcolor=black>&nbsp;</td>
		<td height=50 bgcolor=black colspan=2>
			<table>
				<tr>
					<td>&nbsp;&nbsp;<font size=5><a class=menu href=?menu=meu>Menu</a></font>&nbsp;&nbsp;</td>
				</tr>
			</table
		</td>
		<td height=50 bgcolor=black>&nbsp;</td>
	</tr>
</table>

Open in new window


This img
<img src=http://www.activenquiry.info/images/brand-GPT.png height=200>

Open in new window

is what I would like to have the black bar go underneath the bottom (where as currently the black bar isnt there)

I have considered cutting the image into 2 however this is a template website and many different logos, etc will be used, so cutting isnt an option - where i need the full logo

Thanks in advance
0
Comment
Question by:Graeme
  • 3
  • 3
7 Comments
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 500 total points
ID: 41779553
Well, this comes from rowspan=2, the picture spans two rows, so next tr leaves a gap for the second td.

If you remove that the first row will be higher, pushing everything down.

If you don't want that, but allow the logo to overflow into the next row, then use absolute position:

<td height=190 width=200 valign=middle><a href=?><img style='position:absolute' src=http://www.activenquiry.info/images/brand-GPT.png height=200></a></td>

Open in new window


PS: you might also try table-layout:fixed, as per this article: https://css-tricks.com/fixing-tables-long-strings/

Bye, Olaf.
0
 
LVL 54

Expert Comment

by:Julian Hansen
ID: 41779578
It is generally not considered a good idea to use tables for layout?

Can you post a mockup (image) of how you want the screen to look - so we can potentially suggest a different approach.
0
 

Author Comment

by:Graeme
ID: 41780178
Julian - here is the pic of how i want it to look

Logo-howto.png
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 41780190
Have you tried, what I gave? At least it goes in that direction, the bar is gapless and the logo overlaps. On my browsers the logo appears too low, but you can adjust the position.

Bye, Olaf.
0
 

Author Comment

by:Graeme
ID: 41780193
Hi Olaf, just trying now, will be back to you in a little bit, thanks for replying and following up :)
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
ID: 41780208
Relative positioning also works:

style='position:relative; top:30px;'

Open in new window


Dipping the logo down 30px from it's usual position.

Bye, Olaf.

PS: The essential part is to not use rowspan and instead move the image from its original position, the default css will allow overflow, if not, also set overflow:visible instead of hidden.

PPS: It's true what others say, this layout does not essentially qualify for being done with a tabl, but if you stick with that, what qualifies for a span is the black bar, it could be a single td with colspan of the number of columns the table has, so it's just one black cell.
0
 

Author Closing Comment

by:Graeme
ID: 41780256
Hi Olaf have tried your way and with a little adjustment works! :)

position:absolute; top:80px

thanks!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Form Processing in PHP 11 41
Change text to radio button and calendar form 2 47
Alignment is not working correctly. 8 38
MouseOver help for Intranet website 2 22
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now