Laying Text on Top of a background Image in an HTML table - html

I am a relative newbee to HTML. Please be gentle!
I am trying to lay some text on top of a background image in am HTML email and am getting lost in the finer syntax. The background image is not showing up. I believe it is in fact getting pulled, but simply not being rendered (I could be very wrong)
<table width="100%">
<tr>
<td style="margin:0; padding:0; margin-top:1px; background-image:url ('http://www.insurehomehealth.com/MM/greenbar.png')";>My Text</td>
</tr>
</table> <!--end table-->
Thanks for teaching me a in advance!

You added a space between url and (
So replace:
background-image:url ('http://www.insurehomehealth.com/MM/greenbar.png');
by
background-image:url('http://www.insurehomehealth.com/MM/greenbar.png');

Related

Netsuite Advanced PDF footer centering issue

I am customizing forms in NetSuite and have gotten everything to work as I would want, except the footer. For some reason the text-align: center function is working based on the number of characters in the row of the footer, rather than the center of the page. Below are images of my code and print examples that show the error better. The only difference in the code between footer code images 1 and 2 is that I removed the word "number" in row 55 to depict the centering is based on characters.
Footer Code 1
Footer Print 1
Footer Code 2
Footer Print 2
If you were to show the borders on your tds you'd get a better sense of what's going on. Basically you are not providing hints for the td and table sizes so the normal table width processing is happening. ie. the tables will only be wide enough to hold the text so they appear to be text size based.
Also I suspect you have a lot more markup than you need. The following will give you what I think you are looking for. Note that you may want to play with padding to get the correct left and right alignments.
<macro id="nlfooter">
<hr />
<table class="footer" style="width: 100%;">
<tr>
<td align="left" colspan="4">email</td>
<td align="center" colspan="6">Phone</td>
<td align="right" colspan="4">Page info</td>
</tr>
<tr>
<td align="center" colspan="14">
<b>Thank you</b>
</td>
</tr>
</table>
</macro>

Basic HTML table formatting for email

I am making a simple newsletter layout that can only contain basic HTML but am getting caught up on formatting it properly. I have very little html experience, if I could use css I could lay this out but this is meant to be low level html that most e-mail clients can display properly.
This is a bit of code that I've done to get the image and a button (in the position of button 2) looking correct but it's getting the top and bottom buttons sitting there correctly that's the issue.
<table width="100%" style="text-align:center;">
<td>
<img src="http://localhost/temp/leftpic.png"></td>
<td>
<img src="http://localhost/temp/button.png"></td>
</table>
This is my design outcome. With the outter border being a table border centered in the middle of the page.
Is it possible to format something relatively close to this without using css?
I appreciate any help, cheers.
You CAN use css, you just have to avoid third-party files. You need to define the CSS rules inline, that is, in the style attribute, as you are already doing it for table. However, your HTML is invalid. You need to have tr elements outside your td elements and it is healthy to actively wrap your tr elements inside a tbody, which should be the child of your table.
By the way: the reason one should avoid third-party css in this case is that it might mess the design of the page of gmail/yahoo.
Something like this will start you off... This is with no CSS and no styling (other than what you have originally).
Although you state no CSS yet your first line is styling (albeit inline). Did you just mean no external file?
This is how we used to do layout before CSS, so this is using HTML tables:
<table width="100%" style="text-align:center;" border="1">
<tr>
<td width="50%">
<img src="http://localhost/temp/leftpic.png" width="390" height="480" />
</td>
<td>
<table>
<tr>
<td><input type="button" value="bn1" /></td>
</tr>
<tr>
<td><input type="button" value="bn2" /></td>
</tr>
<tr>
<td><input type="button" value="bn3" /></td>
</tr>
</table>
</td>
</tr>
</table>
Since you have a fixed height of your image on left, you can also use
<tr height="160">
Since 160 * 3 = 480 (the height of your image)
See an example here https://jsfiddle.net/on6ytfyn/
You probably want to remove the border in the first line of code too.

HTML Table with images

so i am currently re making the site for my university's drama department and i want to add 3 images side by side (with spacing between them). They also need to have captions. But the caption needs to have a header (that is styled differently than the caption itself) followed by the caption itself. having looked around here and other places i figured i would be able to do this using a table since formatting size would be easiest this way. I have been at this portion of the site for almost 1 month and have tried numerous other methods (divs, tables, etc.) I was wondering if someone else has done something like this and would be able to impart some advice. The site currently is located here: drama site. Any help would be appreciated (i hope this follows the guidelines, first time asker)
Edit: The following is the portion of the code i need help with:
function windowSize() {
var w = var w = document.getElementById('body').clientWidth;
document.getElementById('newsTable').style.width = w + 'px';
document.getElementById('newsItems').style.height = document.getElementById('newsItems').clientWidth + 'px';
}
<body id="body" onload="windowSize();getCurrentPage();" onresize="windowSize()">
<table id="newsTable" cellpadding="0" border="0">
<tr>
<td id="newsItems" align="center" background="http://i.imgbox.com/5GLGmmDE.gif">1</td>
<td id="newsItems" align="center" background="http://i.imgbox.com/5GLGmmDE.gif">2</td>
<td id="newsItems" align="center" background="http://i.imgbox.com/5GLGmmDE.gif">3</td>
</tr>
<tr>
<td id="newsItems" align="center">4</td>
<td id="newsItems" align="center">5</td>
<td id="newsItems" align="center">6</td>
</tr>
</table>
</body>
I don't want the pictures to be as big as they are in the link, i would like them to be a bit smaller. I would also like some room between them. Currently when the page gets bigger the image starts to repeat. If i took the repeat off then it would have blank space where it would normally repeat
Probably the nicest option would be to use bootstrap. It can do a lot of the columner work for you. But if that sounds a little complex, here is a simple fiddle with three images side by side.
http://jsfiddle.net/44uv9a2m/
I'm just wrapping the images and their captions in divs, then giving them a fixed width.
.oneThird{
width:30%;
float:left;
margin:.5%;
}
.oneThird img{
width:100%;
}
<div class="oneThird">
<img src="http://www.photosnewhd.com/media/images/picture-wallpaper.jpg"></img>
<p>Caption</p>
</div>
<div class="oneThird">
<img src="http://www.photosnewhd.com/media/images/picture-wallpaper.jpg"></img>
<p>Caption</p>
</div>
<div class="oneThird">
<img src="http://www.photosnewhd.com/media/images/picture-wallpaper.jpg"></img>
<p>Caption</p>
</div>
* Edit *
This is a basic bootstrap example.
http://www.bootply.com/n6AdJPYIe3

HTML td background image not displaying

I have my table with <td>s. This <td> contains a background element which is not displaying.
Below is my HTML table.
<div class="left">
<table cellspacing="0" cellpadding="0" border="0">
<td class="displayroundtable"></td> <!-- for displaying background image -->
<td><img src="<?php echo $this->static_address;?>images/MAX-RATING-100.jpg"></td>
</table>
In the CSS,
.displayroundtable{
background-image:url('<?php echo $this->static_address;?>images/2321.png');
}
I don't know why my background image never gets displayed?
Make sure there is a width set on your empty cell, or else it will end-up at 0px thus not displaying anything. Also make sure that the browser renders the empty cells using the CSS rule empty-cells:show on the table.
http://www.w3schools.com/cssref/pr_tab_empty-cells.asp
The table needs TR to be standard compliant. I don't think it is the reason why your background is not displaying but make sure you surround your lines between <tr> .

iframe in table - cant overlay

This is my scenario
<div>
<table>
<tr>
</tr>
<tr>
<td>
<div id="innerDiv">
This div contains background image</div>
<iframe></iframe>
</td>
</tr>
<tr id="thirdTR">
<td>
<%--i have table here with a div that has a background image--%>
</td>
</tr>
</table>
</div>
Now when i try to have the "innerDiv" over the "thirdTR" along with the iframe, the div goes behind the "thirdTR". I even tried setting the zindex as high as possible. Can anyone please help me?
Regards,
Lakxman Kumar C
Edited: This is the css that i have for the innerDiv
position:absolute;
z-index:999
you can't lay a div over an iframe, simply impossible. you'll have to find a workaround (maybe using a div and AJAX to replace the iframe... or changing your layout so you don't need something above the frame)
You aren't allowed to put things over iframes in the html standard. If you could, people could hide links on other pages and phish more easily etc.