I have been using DreamWeaver for a number of years to build simple web sites and have never had any difficulty using tables to space out text on a page.
In my most recent project, I have created a 7 (row) by 2 (column) table inside a 1 x 1 table (the 1 x 1 contains a Photoshop-generated HTML slice as a background) into which I am aiming to enter a label (column 1) and associated information (column 2). When I look at the outcome in either DW Live View or a browser, the contents of column 2 are written over the top of column 1.
If I extract the code for the 7 x 2 table and paste it into a blank page it works fine.
I have uploaded the offending page to: http://www.onthepeninsula.biz/new/lucyscafe/index.html
The bottom row contains four columns (column two has been split into three cells for that row only. The content in column 2 & 3 have both been written into column 1.
Link to page was wrong - should have been http://www.onthepeninsula.biz/new/lucyscafe/index.html
<html>
<head>
<title>On The Peninsula | Lucy's Cafe</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
background-color: #2A599E;
margin-left: 10px;
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
}
</style>
<link href="../otp.css" rel="stylesheet" type="text/css">
<script language="javascript">
<!--//BEGIN Script
function map(url) {
link =
window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=640,height=565,left=100,top=150");
}
//END Script-->
</script>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<body bgcolor="#FFFFFF" onLoad="MM_preloadImages('../images/buttons/home4.jpg','../images/buttons/name4.jpg','../images/buttons/category4.jpg','../images/buttons/pricing4.jpg','../images/buttons/join4.jpg','../images/buttons/contact4.jpg','../images/buttons/social4.jpg')">
<!-- Save for Web Slices (shop.psd) -->
<table width="719" height="280" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td colspan="5">
<img src="../images/shop/shop_01.jpg" width="1040" height="40" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="40" alt=""></td>
</tr>
<tr>
<td rowspan="18">
<img src="../images/shop/shop_02.jpg" width="40" height="1000" alt=""></td>
<td colspan="3">
<img src="heading.jpg" width="960" height="80" alt=""></td>
<td rowspan="18">
<img src="../images/shop/shop_04.jpg" width="40" height="1000" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="80" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="../images/shop/shop_05.jpg" width="960" height="31" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="31" alt=""></td>
</tr>
<tr>
<td><img src="../images/buttons/home3.jpg" alt="On The Peninsula Home" width="220" height="58" border="0" id="Image42"></td>
<td rowspan="16">
<img src="../images/shop/shop_07.jpg" width="20" height="889" alt=""></td>
<td width="720" height="298" rowspan="6" align="left" valign="top" background="../images/shop/shop_08.jpg"><table width="720" height="290" border="0" cellpadding="5">
<tr>
<td><table width="700" height="280"border="0" cellpadding="5">
<tr>
<td width="170" height="38">Business Name:</td>
<td width="504" height="38">Lucy's Cafe</td>
</tr>
<tr>
<td width="170" height="38">Address:</td>
<td width="504" height="38">26 Talford Street, Mitchell Valley VIC 3999</td>
</tr>
<tr>
<td width="170" height="38">Telephone:</td>
<td width="504" height="38">(03) 9999 9999</td>
</tr>
<tr>
<td width="170" height="38"> </td>
<td width="504" height="38"> </td>
</tr>
<tr>
<td width="170" height="38"> </td>
<td width="504" height="38"> </td>
</tr>
<tr>
<td width="170" height="38"> </td>
<td width="504" height="38"> </td>
</tr>
<tr>
<td width="170" height="38"> </td>
<td width="504" height="38"> </td>
</tr>
</table></td>
</tr>
</table></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="58" alt=""></td>
</tr>
<tr>
<td><img src="../images/buttons/name3.jpg" alt="Browse by Business Name" width="220" height="60" border="0" id="Image"></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="60" alt=""></td>
</tr>
<tr>
<td><img src="../images/buttons/category3.jpg" alt="Browse by Category" border="0" width="220" height="61" id="Image2"></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="61" alt=""></td>
</tr>
<tr>
<td><img src="../images/buttons/pricing3.jpg" alt="Pricing" border="0" width="220" height="59" id="Image3"></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="59" alt=""></td>
</tr>
<tr>
<td>
<img src="../images/shop/shop_12.jpg" width="220" height="1" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td><img src="../images/buttons/join3.jpg" alt="Join On The Peninsula" width="220" height="59" border="0" id="Image4"></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="59" alt=""></td>
</tr>
<tr>
<td>
<img src="../images/shop/shop_14.jpg" width="220" height="1" alt=""></td>
<td rowspan="2">
<img src="../images/shop/shop_15.jpg" width="720" height="31" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img src="../images/buttons/contact3.jpg" alt="Contact On The Peninsula" border="0" width="220" height="59" id="Image5"></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="30" alt=""></td>
</tr>
<tr>
<td width="720" height="519" rowspan="6" valign="top" background="../images/shop/shop_17a.jpg"><table width="720" border="0" cellpadding="10">
<tr>
<td width="700"><p>This is an example of one of the business pages in On The Peninsula. </p>
<p>The top section of each business page contains the important contact and location details for your business, including a link to a location map, if your business has a public-friendly workplace.</p>
<p>Please note that this is an example page and that the email and web addresses listed above are not real - if you click on either, you'll be directed to the email address and Facebook page for On The Peninsula.</p>
<p>In this section of the page, you have the opportunity to provide an overview of your business, what you do, what you sell, your trading hours - pretty much anything that you wish to tell a visitor to your site.</p>
<p>You might be wondering about that black and white square on the bottom left corner of this page. This is called a Quick Response (or QR) code. These are very similar to a barcode and can be read by any one of several QR readers available for smartphones and tablets. These QR readers can be downloaded at no cost.</p>
<p>The codes themselves can be linked to just about any piece of information - web addresses, contact cards, photos ... you name it. We have chosen to use them to create contact records in iPhones, Androids and any other device. We will link the QR code on your page to your contact details so that if someone scans the code on your page, your contact details will be saved on their device. Try it on this page and you'll find that our contact details get loaded into your phone!</p>
<p>Finally, you'll notice that we are supporters of Starlight Children's Foundation and you can be too. If you would like to have the Starlight Support's badge on your page, it will cost you $10 per year. Every dollar rasied via this process will be matched by us and donated directly to Starlight Children's Foundation.</p>
<p> </p></td>
</tr>
</table>
</td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="29" alt=""></td>
</tr>
<tr>
<td>
<img src="../images/shop/shop_18.jpg" width="220" height="1" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td><img src="../images/buttons/social3.jpg" alt="Facebook & Twitter" width="220" height="60" border="0" id="Image6"></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="60" alt=""></td>
</tr>
<tr>
<td>
<img src="../images/shop/shop_20.jpg" width="220" height="30" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="30" alt=""></td>
</tr>
<tr>
<td>
<img src="../images/shop/shop_21.jpg" width="220" height="190" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="190" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="../images/shop/shop_22.jpg" width="220" height="220" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="209" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="../images/shop/shop_23.jpg" width="720" height="41" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="11" alt=""></td>
</tr>
<tr>
<td>
<img src="../images/shop/shop_24.jpg" width="220" height="30" alt=""></td>
<td>
<img src="../images/shop/spacer.gif" width="1" height="30" alt=""></td>
</tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>
Your problem is in the stylesheet. Your opt.css file includes this:
#Table_01 tr td table tr td {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 12px;
color: #FFF;
position: absolute;
}
This sets all the td cells in your table to have absolute positioning. The position values aren't set, so they all end up at (0, 0) on top of each other.
Changing position: absolute to position: relative fixes it.
By the way, I found the problem using the developer tools in Chrome. There are similar tools for Firefox and Internet Explorer. It's worth learning how to use these so you can track down this sort of issue.
Related
I know this is a basic question but I'm having difficultly making my site responsive.
It is a basic page that I've done in Photoshop. I've tried a lot of things to make it responsive with no luck.
Here is my HTML code:
<html>
<head>
<title>newbeebosite</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (newbeebosite.psd) -->
<table id="Table_01" width="1601" height="1401" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="7">
<img src="images/Home_01.jpg" width="1600" height="21" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="21" alt=""></td>
</tr>
<tr>
<td colspan="5" rowspan="2">
<img src="images/Home_02.jpg" width="1216" height="46" alt=""></td>
<td>
<img src="images/Home_03.jpg" width="192" height="45" alt=""></td>
<td>
<img src="images/Home_04.jpg" width="192" height="45" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="45" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="2">
<img src="images/Home_05.jpg" width="384" height="88" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td>
<img src="images/Home_06.jpg" width="78" height="87" alt=""></td>
<td>
<img src="images/Home_07.jpg" width="251" height="87" alt=""></td>
<td colspan="3">
<img src="images/Home_08.jpg" width="887" height="87" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="87" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/Home_09.jpg" width="971" height="160" alt=""></td>
<td>
<img src="images/Home_10.jpg" width="1" height="160" alt=""></td>
<td colspan="2">
<img src="images/Home_11.jpg" width="436" height="160" alt=""></td>
<td>
<img src="images/Home_12.jpg" width="192" height="160" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="160" alt=""></td>
</tr>
<tr>
<td colspan="7">
<img src="images/Home_13.jpg" width="1600" height="1086" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1086" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="78" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="251" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="642" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="244" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="192" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="192" height="1" alt=""></td>
<td></td>
</tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>
As a starter I would add:
<meta name="viewport" content="width=device-width, initial-scale=1">
in the head of your html document.
Explanation
This tells the browsers CSS engine "use the screen width of the device (measured in "device independent pixels") as the basis for your HTML element" - and therefore all "fluidly styled" descendant (child) elements will be affected because their height and width properties are based on their parent elements size.
width=device-width is what instructs the page to match the screen's width in device independent pixels. (as opposed to say width=1024 which would explicitly set the width of the page.)
Now when the browser width changes your CSS rules will be hooked into those changes.
I believe initial-scale=1 establishs a 1:1 relationship between CSS pixels and device independent pixels (If that doesnt make sense dont worry - but I would include it).
Then you need to make the table responsive by removing the fixed width definitions and replacing with width definition that change as the parent containers change size.
There is a good explanation of this here - https://developers.google.com/speed/docs/insights/ConfigureViewport
e.g. like this:
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (newbeebosite.psd) -->
<table id="Table_01" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="7">
<img src="http://lorempixel.com/400/200/" width="80%" height="21" alt=""></td>
<td>
<img src="http://lorempixel.com/400/200/" width="80%" height="21" alt=""></td>
</tr>
<tr>
<td colspan="5" rowspan="2">
<img src="http://lorempixel.com/400/200/" width="80%" height="46" alt=""></td>
<td>
<img src="http://lorempixel.com/400/200/" width="80%" height="45" alt=""></td>
<td>
<img src="http://lorempixel.com/400/200/" width="80%" height="45" alt=""></td>
<td>
<img src="http://lorempixel.com/400/200/" width="80%" height="45" alt=""></td>
</tr>
</table>
<!-- End Save for Web Slices -->
</body>
Here is a working demo - http://jsbin.com/dilejobofu/1/edit?html,output
I've always used rowspan for web site development but now designing and developing email comms rowspan, it appears constantly breaks. In multiple clients it displays with a 10/20px gap. How can I avoid using row span even if I need to have two images side by side in an email (such as a header)?
<html>
<head>
<title>StPatricksDAy-PostCard</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (StPatricksDAy-PostCard.psd) -->
<table id="Table_01" width="657" height="684" border="0" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="6">
<img src="images/StPatricksDAy-PostCard_01.gif" width="19" height="643" alt=""></td>
<td colspan="3">
<img src="images/StPatricksDAy-PostCard_02.gif" width="636" height="14" alt=""></td>
<td rowspan="6">
<img src="images/StPatricksDAy-PostCard_03.gif" width="2" height="643" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/StPatricksDAy-PostCard_04.gif" width="636" height="96" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/StPatricksDAy-PostCard_05.gif" width="636" height="9" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/StPatricksDAy-PostCard_06.jpg" width="257" height="523" alt=""></td>
<td>
<img src="images/StPatricksDAy-PostCard_07.gif" width="368" height="449" alt=""></td>
<td rowspan="3">
<img src="images/StPatricksDAy-PostCard_08.gif" width="11" height="524" alt=""></td>
</tr>
<tr>
<td>
<img src="images/StPatricksDAy-PostCard_09.gif" width="368" height="74" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/StPatricksDAy-PostCard_10.gif" width="625" height="1" alt=""></td>
</tr>
<tr>
<td colspan="5">
<img src="images/StPatricksDAy-PostCard_11.gif" width="657" height="28" alt=""></td>
</tr>
<tr>
<td colspan="5">
<img src="images/StPatricksDAy-PostCard_12.gif" width="657"
height="13" alt=""></td>
</tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>
I have a form that is inside of an iframe and I need to make sure that form submits to the parent of the iframe. Target="_top" and target="_parent" isn't working and I am starting to get a little bit aggravated with myself.
If anyone can point me in the right direction that'd be awesome. :)
I have a normal iframe with the src to an html page - that html page goes has this...
<form action="#" method="post" target="_parent" >
<table id="Table_01" width="308" height="411" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6">
<img src="index_01.png" width="308" height="163" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="4">
<img src="index_02.png" width="112" height="142" alt=""></td>
<td colspan="3" style="background-image: url('optin_name.png');" width="189" height="40" alt="">
<input type="text" name="name" style="background: transparent;border:0px;font-size:25px;width:185px;height:37px">
</td>
<td rowspan="6">
<img src="index_04.png" width="7" height="247" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="index_05.png" width="189" height="33" alt=""></td>
</tr>
<tr>
<td colspan="2" style="background-image: url('optin_email.png');" width="188" height="40" alt="">
<input type="text" name="email" style="background: transparent;font-size:25px;border:0px;width:185px;height:37px;">
</td>
<td rowspan="4">
<img src="index_07.png" width="1" height="174" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="index_08.png" width="188" height="29" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="index_09.png" width="73" height="105" alt=""></td>
<td colspan="2" style="background-image: url('optin_submit.png');" width="174" height="54" alt="">
<input type="submit" name="submit" value=" " style="background: transparent;border:0px;width:170px;height:50px;">
</td>
<td rowspan="2">
<img src="index_11.png" width="53" height="105" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="index_12.png" width="174" height="51" alt=""></td>
</tr>
<tr>
<td>
<img src="spacer.gif" width="73" height="1" alt=""></td>
<td>
<img src="spacer.gif" width="39" height="1" alt=""></td>
<td>
<img src="spacer.gif" width="135" height="1" alt=""></td>
<td>
<img src="spacer.gif" width="53" height="1" alt=""></td>
<td>
<img src="spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="spacer.gif" width="7" height="1" alt=""></td>
</tr>
</table>
</form>
I cannot get it to post to the iframes parent windows opposed to in a new windows and/or inside the iframe itself, both are no no's.
Your action attribute in the form seems to be a problem. Which URL do you want to post your data to? Try replace the # in the action attribute with the target URL.
prevent default submit behaviour
using window.parent to access the parent
let the parent to post the form value of the one in iframe
How to do a Jquery Callback after form submit?
$("#myform").submit(function(event) {
event.preventDefault();
var val = $(this).find('input[type="text"]').val();
// I like to use defers :)
deferred = $.post("http://somewhere.com", { val: val });
deferred.success(function () {
// Do your stuff.
});
deferred.error(function () {
// Handle any errors here.
});
});
Hey I made an image in Photoshop for an email newsletter. I sliced the image and added links to the images I want clicked, but when I send it in an email there are spaces between the images. How can I remove the spaces? Here is the coding.
<html>
<head>
<title>email_template_1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (email_template_1.psd) -->
<table id="Table_01" width="650" height="801" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="8">
<img src="images/ttcc_01.jpg" width="650" height="65" alt=""></td>
</tr>
<tr>
<td colspan="3" rowspan="2">
<img src="images/ttcc_02.jpg" width="507" height="33" alt=""></td>
<td rowspan="2">
<valign=top align=left width=33><img src="images/ttcc_03.jpg" width="33" height="33" border="0" alt="Blog"></td>
<td rowspan="2">
<img src="images/ttcc_04.jpg" width="10" height="33" border="0" alt="space"></td>
<td>
<valign=top align=left width=33><img src="images/ttcc_05.jpg" width="33" height="32" border="0" alt="Facebook"></td>
<td colspan="2" rowspan="2">
<img src="images/ttcc_06.jpg" width="67" height="33" alt=""></td>
</tr>
<tr>
<td>
<img src="images/ttcc_07.jpg" width="33" height="1" alt=""></td>
</tr>
<tr>
<td colspan="8">
<img src="images/ttcc_08.jpg" width="650" height="25" alt=""></td>
</tr>
<tr>
<td colspan="8">
<img src="images/ttcc_09.jpg" width="650" height="162" alt=""></td>
</tr>
<tr>
<td colspan="8">
<img src="images/ttcc_10.jpg" width="650" height="347" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/ttcc_11.jpg" width="504" height="1" alt=""></td>
<td colspan="6">
<img src="images/ttcc_12.jpg" width="146" height="1" alt=""></td>
</tr>
<tr>
<td>
<img src="images/ttcc_13.jpg" width="324" height="72" alt=""></td>
<td colspan="6"><valign=top align=left width=280><img src="images/ttcc_14.jpg" algin="left" width="280" height="72" border="0" alt="Click Here for more Information!"></td>
<td>
<img src="images/ttcc_15.jpg" align="left" width="46" height="72" border="0" alt=""></td>
</tr>
<tr>
<td colspan="8">
<img src="images/ttcc_16.jpg" width="650" height="95" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="324" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="180" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="3" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="33" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="10" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="33" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="21" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="46" height="1" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
and the site
file:///Users/Dad/Dropbox/Apps/site44/ttc.site44.com/ttcc.html
Since your Photoshop is creating tables, and poor ones at that, you have a different issue. I would recommend that you apply the following style to your table:
#Table_01 {
border-collapse: collapse:
}
That should fix the problem.
But if you weren't using tables, you could still have the same issue. This is because the spaces between the images are whitespace. They occur because your server doesn't optimize the HTML output. The reason this is a problem is because images and spaces can both be interpreted as having the CSS property display: inline. (I know some browsers don't do that to images, but when they do, this kind of thing happens.)
The solution I've used is to strip out all whitespace from between tags when it matters. Here's a sample function for doing that.
function stripSpaceBetweenTags(container) {
var rex = />\s+</gm;
var htmlString = $(container).html();
htmlString = htmlString.replace(rex,"><");
$(container).html(htmlString)
}
The container argument is a string that can be used as a valid jQuery selector. What happens is that it strips all cases of whitespace (spaces, tabs, linefeeds, etc.) between tags if there is only whitespace between those tags. This is important: if you have other characters, you don't want them stripped out.
Think of it as an ad hoc optimizer. You don't have to do this to the whole page, and it's probably better if you don't. But if you have a container that holds images which have to be tight, tight, tight, this is a good workaround.
I made web page via Photoshop, sliced it and saved for web and uploaded the html file. It looks just fine in Firefox and Chrome, but IE it is whole different story. Any one know how to fix it and why I`m getting this black padding?
IE:
Firefox, Chrome & Safari:
Code:
<html>
<head>
<title>Shamir Applications</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (Webpage08.psd) -->
<table id="Table_01" width="960" height="720" border="0" cellpadding="0" cellspacing="0" style="margin-right: auto; margin-left: auto;">
<tr>
<td colspan="11">
<img src="images/Webpage08_01.png" width="960" height="237" alt=""></td>
</tr>
<tr>
<td rowspan="6">
<img src="images/Webpage08_02.png" width="130" height="483" alt=""></td>
<td>
<img src="images/Webpage08_03.png" width="138" height="36" alt=""></td>
<td rowspan="6">
<img src="images/Webpage08_04.png" width="142" height="483" alt=""></td>
<td colspan="3">
<img src="images/Webpage08_05.png" width="138" height="36" alt=""></td>
<td rowspan="6">
<img src="images/Webpage08_06.png" width="140" height="483" alt=""></td>
<td colspan="3">
<img src="images/Webpage08_07.png" width="138" height="36" alt=""></td>
<td rowspan="6">
<img src="images/Webpage08_08.png" width="134" height="483" alt=""></td>
</tr>
<tr>
<td rowspan="5">
<img src="images/Webpage08_09.png" width="138" height="447" alt=""></td>
<td colspan="3">
<img src="images/Webpage08_10.png" width="138" height="13" alt=""></td>
<td colspan="3">
<img src="images/Webpage08_11.png" width="138" height="13" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/Webpage08_12.png" width="14" height="146" alt=""></td>
<td>
<img src="images/Webpage08_13.png" width="110" height="110" alt=""></td>
<td rowspan="2">
<img src="images/Webpage08_14.png" width="14" height="146" alt=""></td>
<td rowspan="4">
<img src="images/Webpage08_15.png" width="16" height="434" alt=""></td>
<td>
<img src="images/Webpage08_16.png" width="110" height="110" alt=""></td>
<td rowspan="4">
<img src="images/Webpage08_17.png" width="12" height="434" alt=""></td>
</tr>
<tr>
<td>
<img src="images/Webpage08_18.png" width="110" height="36" alt=""></td>
<td rowspan="3">
<img src="images/Webpage08_19.png" width="110" height="324" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/Webpage08_20.png" width="138" height="17" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/Webpage08_21.png" width="138" height="271" alt=""></td>
</tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>
Try to put this in your css file
img {
border:0;
padding:0;
margin:0;
}
or in the head tag write
<style type="text/css">
img {
border:0;
padding:0;
margin:0;
}
</style>
You could try switching from using the tables mode to using the css export instead?
With regard to Matei Mihai's answer you should probably add this as well:
img {
border:0;
padding:0;
margin:0;
display:block; /* This often removes extra spacing around images in IE */
}