position:fixed made table cells stretch across entire screen - html

I have a table on my site. When I add position:fixed to the table, the cells of the table suddenly stretch across the entire height of the page, even though they have a set height.
as you can see in the code below, each tr has a set height value, but it is ignored when I add position:fixed to the table, and instead, the cells get the height of the entire page, and prevent me from accessing the content of the website.
any help on how to fix this, while still keeping the position:fixed attribute, would be appreciated.
.center {
margin:0 auto;
}
a{
text-decoration:none;
color:red;
}
table{
text-align:center;
width:30%;
left:25%;
/*font-size:larger;*/
}
body{
background-color:midnightblue;
color:snow;
white-space:nowrap;
}
.Error{
color:red;
}
.divSargel{
width:initial;
background-color:snow;
border: solid;
border-color: #000080;
float: left;
margin-left: 0.3%;
color: red;
font-size:x-large;
font-family:monospace;
border-radius: 20px;
text-align: center;
width:100%;
}
.divSargel:hover {
background-color: blue;
transition: linear 0.5s;
}
<table id="navbar" border="1" style="right:0px;left:0px;border-style: solid;border-color:black;margin:0 auto;max-width:999999px; width:100%; height: 100%; background-image: none;">
<tr>
<td colspan="5" style="background-image: url('/Pics/videogames2.jpg'); height:100px; background-repeat: no-repeat; background-size:100% 100%">
</td>
</tr>
<tr style="height:50px">
<td style="border-color: #000000; background-color: #000000; color: #FFFFFF;">
<asp:TextBox ID="txtClock" style="text-align:center" runat="server" width="90%" ReadOnly="true"></asp:TextBox>
</td>
<td style="border-color: #000000; color: #FFFFFF; background-color: #000000">
<asp:TextBox ID="txtPeopleCount" style="text-align:center" runat="server" Width="90%" ReadOnly="true"></asp:TextBox>
</td>
<td style="width:50%;border:medium solid #000080; background-color: #000000;">
<table border="1" style="border-color:snow;width:100%">
<%if (Session["UserName"] == null)
{ %>
<tr>
<td class="textCenter">
<a href="Main.aspx" class="divSargel">
Main
</a>
</td>
<td class="textCenter">
<a href="ShopProducts.aspx" class="divSargel">
Shop
</a>
</td>
</tr>
<%} %>
<%if (Session["UserName"] != null && Session["UserAdmin"] == null)
{ %>
<tr>
<td class="textCenter">
<a href="Main.aspx" class="divSargel">
Main
</a>
</td>
<td class="textCenter" >
<a href="ShowUsers.aspx" class="divSargel">
Show Users
</a>
</td>
<td class="textCenter">
<a href="ShopProducts.aspx" class="divSargel">
Shop
</a>
</td>
<td class="textCenter">
<a href="ShoppingCart.aspx" class="divSargel">
View Cart
</a>
</td>
</tr>
<tr>
<td class="textCenter">
<a href="ShowBank.aspx" class="divSargel">
View Bank
</a>
</td>
<td class="textCenter">
<a href="ShowCreditCards.aspx" class="divSargel">
View credit cards
</a>
</td>
<td class="textCenter">
<a href="ShowOrders.aspx" class="divSargel">
View Orders
</a>
</td>
<td class="textCenter">
<a href="ContactUs.aspx" class="divSargel">
Contact us
</a>
</td>
</tr>
<%} %>
<%if (Session["UserAdmin"] != null)
{ %>
<tr>
<td class="textCenter">
<a href="Main.aspx" class="divSargel">
Main
</a>
</td>
<td class="textCenter" >
<a href="ShowUsers.aspx" class="divSargel">
Show Users
</a>
</td>
<td class="textCenter">
<a href="ShopProducts.aspx" class="divSargel">
Shop
</a>
</td>
<td class="textCenter">
<a href="ShoppingCart.aspx" class="divSargel">
View Cart
</a>
</td>
</tr>
<tr>
<td class="textCenter">
<a href="ShowBank.aspx" class="divSargel">
View Bank
</a>
</td>
<td class="textCenter">
<a href="ShowCreditCards.aspx" class="divSargel">
View credit cards
</a>
</td>
<td class="textCenter">
<a href="ShowOrders.aspx" class="divSargel">
View Orders
</a>
</td>
<td class="textCenter">
<a href="AdminPage.aspx" class="divSargel">
Admin actions
</a>
</td>
</tr>
<%} %></table>
</td>
<%if (Session["UserName"] == null)
{ %>

Try setting the height of the table as desired and mark it as important like
table{
height : 150px !important;
}

Managed to find the problem. for some reason I had a height:100% on the table itself, and so even though the rows had specified heights, upon adding position:fixed the table stretched across the screen.

Related

div flex stretch not applying and doesn't change height

Notice the div is set to display: flex. It has some tables inside it. I can't change the height of the div to take 85% of the page without the tables stretching out evenly inside the pink div.
I'm trying to spread the tables' contents evenly inside the div. I can't find the right rule-set to make it work. I don't know where to change the content class or the .foodiv class.
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
div {
display: flex;
}
.foodiv {
background-color: lightcoral;
display: flex;
flex-direction: column;
justify-content: center;
flex-wrap: wrap;
flex-grow: 4;
flex-basis: auto;
align-content: stretch;
align-self: auto;
width: 100%;
height: 85%;
margin: 10px;
}
.content {
padding: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="food.css">
<title>Document</title>
</head>
<body>
<div class="foodiv">
<center>
<table id="t" style="color:white">
<tr>
<td class="content"><a style="text-decoration:none;" href="pizza.html"><button>Pizza</button></a></td>
<td class="content"><a style="text-decoration:none;" href="pasta.html"><button>Pasta</button></a></td>
<td class="content"><a style="text-decoration:none;" href="burger.html"><button>Burger</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="noodles.html"><button>Noodles</button></a></td>
<td class="content"><a style="text-decoration:none;" href="hs.html"><button>Chinese Hot and Sour
Soup</button></a></td>
<td class="content"><a style="text-decoration:none;" href="cgs.html"><button>Carrot Ginger Soup</button></a>
</td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="breadroll.html"><button>Bread Roll</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="ps.html"><button>Paneer Sandwich</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="vegetablemaggie.html"><button>Vegetable
Maggie</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="frenchtoast.html"><button>French
Toast</button></a></td>
<td class="content"><a style="text-decoration:none;" href="tacos.html"><button>Tacos</button></a></td>
<td class="content"><a style="text-decoration:none;" href="momos.html"><button>Momos</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="pt.html"><button>Paneer Tikka</button></a></td>
<td class="content"><a style="text-decoration:none;" href="ccb.html"><button>Crispy Chilly
Babycorn</button></a></td>
<td class="content"><a style="text-decoration:none;" href="ac.html"><button>American Chopsuey</button></a>
</td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="q.html"><button>Quesadilla</button></a></td>
<td class="content"><a style="text-decoration:none;" href="chococake.html"><button>Chocolate
Cake</button></a></td>
<td class="content"><a style="text-decoration:none;" href="lbp.html"><button>Lemon Bar Peeps</button></a>
</td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="sbpie.html"><button>Strawberry Pie</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="tiramisu.html"><button>Tiramisu</button></a></td>
<td class="content"><a style="text-decoration:none;" href="pc.html"><button>Panna Cotta</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="bmc.html"><button>Blueberry Muffin
Cake</button></a></td>
<td class="content"><a style="text-decoration:none;" href="cheesecake.html"><button>Cheesecake</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="cm.html"><button>Chocolate Milkshake</button></a>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
The only child of your flex container .foodiv is the <center> tag - one flex child can stretch, but the element in there (the "grandchildren") won't be affected by that flex setting. Erase the <center> tag and center the tables with another method.
there was some problems with you code. replace you HTML & CSS with this code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="food.css" />
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.foodiv {
background-color: lightcoral;
height: 85vh;
margin: 10px;
padding: 30px;
display: flex;
flex-direction: column;
align-items: stretch;
}
#t {
display: flex;
}
tbody {
display: flex;
flex-wrap: wrap;
}
button {
padding: 5px 15px;
}
tr {
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="foodiv">
<table id="t" style="color: white;">
<tbody>
<tr>
<td class="content">
<a style="text-decoration: none;" href="pizza.html"
><button>Pizza</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="pasta.html"
><button>Pasta</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="burger.html"
><button>Burger</button></a
>
</td>
</tr>
<tr>
<td class="content">
<a style="text-decoration: none;" href="noodles.html"
><button>Noodles</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="hs.html"
><button>Chinese Hot and Sour Soup</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="cgs.html"
><button>Carrot Ginger Soup</button></a
>
</td>
</tr>
<tr>
<td class="content">
<a style="text-decoration: none;" href="breadroll.html"
><button>Bread Roll</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="ps.html"
><button>Paneer Sandwich</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="vegetablemaggie.html"
><button>Vegetable Maggie</button></a
>
</td>
</tr>
<tr>
<td class="content">
<a style="text-decoration: none;" href="frenchtoast.html"
><button>French Toast</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="tacos.html"
><button>Tacos</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="momos.html"
><button>Momos</button></a
>
</td>
</tr>
<tr>
<td class="content">
<a style="text-decoration: none;" href="pt.html"
><button>Paneer Tikka</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="ccb.html"
><button>Crispy Chilly Babycorn</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="ac.html"
><button>American Chopsuey</button></a
>
</td>
</tr>
<tr>
<td class="content">
<a style="text-decoration: none;" href="q.html"
><button>Quesadilla</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="chococake.html"
><button>Chocolate Cake</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="lbp.html"
><button>Lemon Bar Peeps</button></a
>
</td>
</tr>
<tr>
<td class="content">
<a style="text-decoration: none;" href="sbpie.html"
><button>Strawberry Pie</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="tiramisu.html"
><button>Tiramisu</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="pc.html"
><button>Panna Cotta</button></a
>
</td>
</tr>
<tr>
<td class="content">
<a style="text-decoration: none;" href="bmc.html"
><button>Blueberry Muffin Cake</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="cheesecake.html"
><button>Cheesecake</button></a
>
</td>
<td class="content">
<a style="text-decoration: none;" href="cm.html"
><button>Chocolate Milkshake</button></a
>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

bootstrap grid doesn't align the same way as a <table>

I'm trying to convert from table to bootstrap grid for mobile comparability. Below is an image of both of them on one page but even though they both follow the same css, bootstrap isn't at the center unlike table is. Can someone please explain this to me because this makes no sense.
Thank you
table is at the top and Bootstrap is at the bottom
and here's my HTML
.platinum2 {
color: #FFFFFF;
font-size: 30px;
font-weight: 600;
line-height: 41px;
text-align: center;
}
.package_text {
color: #FFFFFF;
font-family: "lato";
font-size: 14px;
font-weight: 500;
line-height: 26px;
}
.package_price {
color: #FFFFFF;
font-family: "lato";
font-size: 16px;
font-weight: bold;
line-height: 14px;
text-align: center;
}
.glyphicon-star{
font-size: 20px;
}
<div class="row" style="width:50%;margin-left:25% ; margin-bottom:25px; text-align:center">
<h1 class="platinum2">Platinum <br><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /> </h1>
<div class="col-md-6" >
<span class="package_text">Hand Wash<br>Full Interior<br>Complete Vacuum<br>Leather Clean+Shine<br>
<br />
Tire Dressing<br>Tire and Rim Detailing<br>Engine Shampoo<br />
<br /></span>
<span class="package_price"> Cars: $189</span>
</div>
<div class="col-md-6">
<span class="package_text">Roof Liner<br>Full Body Wax<br>Clay Bar Treatment<br>Interior Shampooing<br />
<br />
Complete Detail<br>In & Out Windows<br>Door Jam Cleaning<br />
<br /></span>
<span class="package_price">SUVs: $199</span>
</div>
</div>
</div>
<div class="container" style="background-image:url('/images/StripedBGDetailPackages.png' ); align-items:center; text-align:center; margin-top:25px; padding-top:25px; background-size:100%" >
<table style="width:50%;margin-left:25% ; margin-right:25%; margin-bottom:25px;">
<tr>
<td class="platinum2">Gold</td>
<td class="platinum2">Silver</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
</tr>
<tr>
<td class="package_text">Hand Wash</td>
<td class="package_text">Hand Wash</td>
</tr>
<tr>
<td class="package_text">Complete Vacuum</td>
<td class="package_text">Clay Bar Treatment</td>
</tr>
<tr>
<td class="package_text">Interior Shampooing</td>
<td class="package_text">Complete Body Wax</td>
</tr>
<tr>
<td class="package_text">Leather Clean+Shine</td>
<td class="package_text">Tire and Rim</td>
</tr>
<tr>
<td class="package_text">Complete Deetail</td>
<td class="package_text">Detailing</td>
</tr>
<tr>
<td class="package_text">In & Out Windows</td>
<td class="package_text">Tire Dressing</td>
</tr>
<tr class="package_text">
<td> </td>
<td> </td>
</tr>
<tr>
<td class="package_price">Cars:$119 SUVs:$129</td>
<td class="package_price">Cars:$99 SUVs:$109</td>
</tr>
</table>
<div class="row" style="width:50%;margin-left:25% ; margin-right:25%; margin-bottom:25px;">
<div class="col-md-6">
<table>
<tr>
<td class="platinum2">Gold</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
</tr>
<tr>
<td class="package_text">Hand Wash</td>
</tr>
<tr>
<td class="package_text">Complete Vacuum</td>
</tr>
<tr>
<td class="package_text">Interior Shampooing</td>
</tr>
<tr>
<td class="package_text">Leather Clean+Shine</td>
</tr>
<tr>
<td class="package_text">Complete Deetail</td>
</tr>
<tr>
<td class="package_text">In & Out Windows</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="package_price">Cars:$119 SUVs:$129</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table>
<tr>
<td class="platinum2">Silver</td>
</tr>
<tr>
<td><span class="glyphicon glyphicon-star" style="color:#FFFACC" /></td>
</tr>
<tr>
<td class="package_text">Hand Wash</td>
</tr>
<tr>
<td class="package_text">Clay Bar Treatment</td>
</tr>
<tr>
<td class="package_text">Complete Body Wax</td>
</tr>
<tr><td class="package_text">Tire and Rim</td></tr>
<tr><td class="package_text">Detailing</td></tr>
<tr><td class="package_text">Tire Dressing</td></tr>
<tr><td> </td></tr>
<tr><td class="package_price">Cars:$99 SUVs:$109</td></tr>
</table>
</div>
</div>
To debug, first I added the following since your text are white, and border to everything with 1px solid red color, by doing this it is very easy to see why it is not centered! check the link
body {
background-color: gray;
}
* {
border: 1px solid red;
}
https://jsfiddle.net/dalinhuang/aLpv8k3f/4/
Now, as you can see Gold BS it is in the correct position, that's because
you need only add the following class to your <table class="fullwidth">
.fullwidth {
width: 100%;
}
OK, full solution, remove the debug stuff we added:
https://jsfiddle.net/dalinhuang/aLpv8k3f/5/
Also I think your star are not in the same line, update your .glyphicon-star to add this margin-top: -1px;.
.glyphicon-star {
font-size: 20px;
margin-top: -1px;
}

Extra space appears in table cells when I reduce height

I am having trouble reducing the height of the table cells in rows 1 and 2. I tried setting the table rows to 100 pixels within html, but when I do that table cells below the row grow larger as if compensating for the missing space. I do not see this happening in the fiddle below, but I am having this problem in Chrome. I would appreciate any help. The relevant code is below, and the full page is in the fiddle.
https://jsfiddle.net/9qLg7c31/2/
HTML:
Resume Page
<br>
<table class="no-spacing">
<tr style="height:100px">
<td>
Northwestern University
</td>
<td>
Class of 2016
</td>
<td>
Bachelors of Science in Journalism
</td>
<td style="text-indent: 10px">
Integrated Marketing Certificate
</td>
</tr>
<tr>
<td>
Field
</td>
<td>
2012
</td>
<td>
2013
</td>
<td>
2014
</td>
<td>
2015
</td>
<td>
2016
</td>
</tr>
<tr>
<td>Content Marketing</td>
<td style="background-color:white">
<div class="dropdown";>
<img src="http://st.hzcdn.com/fimgs/5f33bbc80182569c_3779-w173-h173-b1-p0--whatasteele.jpg">
<div class="dropdown-content">
</div>
</div>
</td>
<td style="background-color: white">
</td>
<td>
</td>
<td style="background-color: white">
<div class="dropdown">
<img src="http://www.reelnreel.com/wp-content/uploads/2015/01/Wochit.png">
<div class="dropdown-content">
</div>
</div>
</td>
<td style="background-color:white">
</td>
</tr>
<tr>
<td>
Multimedia Journalism
</td>
<td>
</td>
<td>
</td>
<td style="background-color: blue">
<div class="dropdown">
<img src="http://www.complaintsboard.com/thumb.php?src=chicago-tribune.jpg&wmax=900&hmax=900&quality=90&nocrop=1&bname=120767">
<div class="dropdown-content">
</div>
</div>
</td>
<td style="background-color: black">
<div class="dropdown">
<div class="dropdown-content">
<img src="http://onekreate.com/wp-content/uploads/2014/04/40_Inc_Magazine.jpg">
</div>
</div>
</td>
<td>
</td>
</tr>
<tr>
<td>Volunteer Work</td>
<td style="background-color: purple">
<div class="dropdown">
<div class="dropdown-content">
<img src="https://pbs.twimg.com/profile_images/570772503543291904/uYixut-M.jpeg" style="width:100px; height:100px">
</div>
</td>
<td style="background-color: purple">
</td>
<td style="background-color: purple">
</td>
<td>
</td>
<td>
</tr>
</table>
CSS:
#resume {
width: 100%;
height: 150%;
background-color: rgb(0,300,200);
margin-bottom:0px;
z-index:0;
}
#resume table{
background-color: rgb(0,200,200);
margin-left: 2.5%;
width:95%;
height:100%;
padding-bottom:10px;
border-radius: 20px;
}
#resume table ul{
color: rgb(0,300,200);
font-size:20px;
}
.no-spacing {
border-spacing:0; /* Removes the cell spacing via CSS */
border-collapse: collapse; /* Optional - if you don't want to have double border where cells touch */
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content{
display: hidden;
}
.dropdown:hover .dropdown-content{
display:block;
position: relative;
width:300px;
}
#resume table th{
padding:15px 0 15px 0;
}
#resume table img{
width:150px;
height:100px;
}
#resume table tr:nth-child(3), #resume table tr:nth-child(4), #resume table tr:nth-child(5){
height:200px;
}

CSS Height of Table Exceeds Height of Body

I'm trying to use a table as a replacement for an image map so that it can be responsive, but for some reason, after setting the table's height to 100%, it still goes past the body, and I can't figure out why.
CSS and HTML:
body,
html {
padding:0;
margin:0;
width:100%;
height:100%;
}
body {
background-color:black;
}
html {
background-color:white;
}
table {
border-spacing:0;
border-collapse: collapse;
height:100%;
margin:0 auto;
}
td {
margin:0;
padding:0;
height:100%;
}
tr {
height:100%;
}
<table>
<tr data-name="row1">
<td data-name="pic1">
<a class="openBox" data-source="split/A1-4096-0171.mp4">
<img src="thumb/A1-4096-0171.png">
</a>
</td>
<td data-name="pic2">
<a class="openBox" data-source="split/B1-4096-0171.mp4">
<img src="thumb/B1-4096-0171.png">
</a>
</td>
</tr>
<tr data-name="row2">
<td data-name="pic3">
<a class="openBox" data-source="split/A2-4096-0171.mp4">
<img src="thumb/A2-4096-0171.png">
</a>
</td>
<td data-name="pic4">
<a class="openBox" data-source="split/B2-4096-0171.mp4">
<img src="thumb/B2-4096-0171.png">
</a>
</td>
</tr>
<tr data-name="row3">
<td data-name="pic5">
<a class="openBox" data-source="split/A3-4096-0171.mp4">
<img src="thumb/A3-4096-0171.png">
</a>
</td>
<td data-name="pic6">
<a class="openBox" data-source="split/B3-4096-0171.mp4">
<img src="thumb/B3-4096-0171.png">
</a>
</td>
</tr>
<tr data-name="row4">
<td data-name="pic7">
<a class="openBox" data-source="split/A4-4096-0171.mp4">
<img src="thumb/A4-4096-0171.png">
</a>
</td>
<td data-name="pic8">
<a class="openBox" data-source="split/B4-4096-0171.mp4">
<img src="thumb/B4-4096-0171.png">
</a>
</td>
</tr>
</table>
Screenshot of the issue:
The black is the body background is the body tag, while the white is the html tag, so the table is, for some reason, going outside the body going by the way it looks. It should be no taller than the window based on my CSS, correct?

Using z-index in a table cell to write over an image

I want to place text on top of an image that I placed in a table cell.
I tried to use the z-index but the text keeps appearing under the image.
I created a class called p1 that positioned the image relative(not sure how I should handle this inside of a table) and the z-index -1.
I then added the class id in the table cell tag.
What I have so far:
.font1 {
font-family: Verdana, Geneva, sans-serif;
font-size: small;
text-align: left;
}
.hangingindent {
padding-left: 100px;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
}
.hangingindent2 {
padding-left: 75px;
}
.p1 {
position: relative;
z-index: -1;
}
.backbox {
z-index: -1;
position: relative;
left: 0;
right: 0;
botton: 0;
}
.text {
z-index 100;
color: #0000000;
font-size: 14px;
position: absolute;
top: 100px;
right: 200px;
overflow: hidden;
}
<table width="1013" border="0" align="center" cellpadding="0">
<tr>
<td colspan="5">
<img src="images/images2/header.gif" width="1013" height="642" />
</td>
</tr>
<tr>
<td colspan="5">
<img src="images/images2/menu-grid.gif" width="1013" height="232" />
</td>
</tr>
<tr>
<td width="55"> </td>
<td width="231">
<img src="images/images2/solutions.jpg" width="204" height="46" />
</td>
<td width="233">
<img src="images/images2/capabilities.jpg" width="204" height="46" />
</td>
<td width="232">
<img src="images/images2/art services.jpg" width="204" height="46" />
</td>
<td width="254">
<img src="images/images2/contact us.jpg" width="204" height="46" />
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5" class="hangingindent2">
<img src="images/images2/WELCOME.gif" width="500" height="100" />
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5" class="hangingindent">
<p>Since 1968, Packaging Products Corporation (PPC) has been a leader in the flexographic printing and converting industry.
<br />Our focus on emerging technologies in film substrates, ink systems, and controlled atmosphere packaging, enables us to
<br />provide the highest quality products at the most competitive prices.</p>
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5">
<div class="backbox">
<img src="images/images2/bottom2.gif" width="1013" height="810" />
<div class="text">This is a test to see where the text will land</div>
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
</table>
As I got from your question is you want to put text over an image. So to do it, there is no need to use z-index. you can do it by setting absolute position of p tag and make td tag as position relative.
demo for it is you can use the link
<table>
<tr>
<td>
<p>Hello</p>
<img src="http://www.freakypic.in/wp-content/uploads/2014/08/flower-images.jpg" />
</td>
</tr>
</table>
CSS:
img {
width:200px;
}
td {
border:2px solid red;
position:relative;
}
p {
position:absolute;
color:yellow;
font-size:30px;
top:0px;
left:70px;
}
You can change the markup little bit.!Z-index will work with position set to other than static (which is default).
Here, you can remove the <img> tag & display the image as background image.
Other solution wrap the text in <p> or <div> & make it position: absolute & immediate parent <td> as position:relative (This is mentioned earlier already)
little code explanation
exp1 -- background-image
td {
background-image: url("");
background-position: left top fixed;
}
exp1 - HTML markup
<td>Data to be there on top of the image</td>
Please check this link! - JSFIDDLE