Keeping width of two tables same - html

Here I have 2 tables, I want these 2 tables' width to be same, when the Confirmer name is long the second table expands but the first one remains same, I want both of them to be of same width in any situation, how can that be done? Check this JS Bin example.
HTML:
<table>
<tbody><thead><tr><th>1.5 - STATE</th>
</tr></thead><tr>
<td>
<b>Issued by </b>User Administrator <b>on</b><font face="verdana" size="1" color="red"> 24/05/2013 06:43
</font></td>
</tr>
</tbody></table>
<table>
<tbody><tr>
<th>
Confirmer
</th>
<th>Status</th>
<th>Date</th>
<th>Comment</th>
</tr>
<tr>
<td>Pathak Chankey</td>
<td>
<img src="xyz.png">
</td>
<td> 24/05/2013 06:43 </td>
<td> </td>
</tr>
<tr>
<td>Lastname Firstname</td>
<td>
<img src="xyz.png">
</td>
<td> 24/05/2013 06:43 </td>
<td> </td>
</tr>
<tr>
<td>User Administrator</td>
<td>
<img src="xyz.png">
</td>
<td> 24/05/2013 06:43 </td>
<td> </td>
</tr>
</tbody></table>
CSS:
thead{
background-color: grey;
}
table, td
{
background:#fffAF0;
border: 1px solid black;
border-collapse:collapse;
}

Just add a container and set a width in your container then apply the 100% width to your tables like this
div{
width:400px;
}
table {
width:100%;
}
<div>
<table></table>
<table></table>
</div>
http://jsbin.com/iduciw/32/edit

Why do not you use a single table?
<table>
<tr>
<th colspan="4">1.5 - STATE</th>
</tr>
<tr>
<td colspan="4"><b>Issued by </b>User Administrator <b>on</b><font face="verdana" size="1" color="red"> 24/05/2013 06:43 </font></td>
</tr>
<tr>
<th> Confirmer </th>
<th>Status</th>
<th>Date</th>
<th>Comment</th>
</tr>
<tr>
<td>Pathak Chankey</td>
<td><img src="xyz.png"></td>
<td> 24/05/2013 06:43 </td>
<td> </td>
</tr>
<tr>
<td>Lastname Firstname</td>
<td><img src="xyz.png"></td>
<td> 24/05/2013 06:43 </td>
<td> </td>
</tr>
<tr>
<td>User Administrator</td>
<td><img src="xyz.png"></td>
<td> 24/05/2013 06:43 </td>
<td> </td>
</tr>
</table>

Related

How to keep Elements to separate pages - for printing - without overflow to additional page

I am trying to print some tables and an image on two separate pages.
However when I do this I always get additional page that spills over into a 3rd page when I am trying to print.
How do I get rid of the additional page space or overflow that appears on a 3rd page when printing?
I have added page break after and before in the past in various places to remedy this with no success.
The tables will move in size due to data that is shoved in them - but never more than a page. So the image on the secopnd page needs to allow for that as well as keeping to the second page. I am struggling with this. I've tried using absolute position to get it to stay fixed, but it still moves when the table moves, pushing into a third page at times.
Any suggestions help. Thanks
HTML:
<body>
<table class="tableWrapper" cellpadding="3">
<tr class="no-counter">
<td>
<table class="table headingTable">
<tr class="no-counter">
<td>Total<br />Persons<br />Onboard</td>
<td> </td>
</tr>
</table>
</td>
<td>
<table class="table headingTable">
<tr class="no-counter">
<th colspan="4"> <#Tour_Resource type="lookup" value="resource_resource" display="resource_name"></th>
</tr>
<tr class="no-counter">
<td>Date</td>
<td><#Tour_Date_In format="ddd d mmm yyyy"></td>
<td>Wind Direction</td>
<td> </td>
</tr>
<tr class="no-counter">
<td>Dept Time</td>
<td><#Tour_Date_In format="h:nn am/pm"></td>
<td>Wind Strength</td>
<td></td>
</tr>
<tr class="no-counter">
<td>Ret Time</td>
<td></td>
<td>Swell/Waves</td>
<td></td>
</tr>
<tr class="no-counter">
<td>Dive Site</td>
<td>
<#Tour_TourTemp type="lookup" value="tourtemp_tourtemp" display="tourtemp_name">
</td>
<td>Tide</td>
<td></td>
</tr>
</table>
</td>
<td>
<table class="table headingTable">
<tr class="no-counter">
<th colspan="2">Dive Plan / Skipper</th>
</tr>
<tr class="no-counter">
<td>Planned Total Dive Time</td>
<td style="text-align:right;">min</td>
</tr>
<tr class="no-counter">
<td>Time in (first dive)</td>
<td style="text-align: center;">:</td>
</tr>
<tr class="no-counter">
<td>Time out (last dive)</td>
<td style="text-align: center;">:</td>
</tr>
<tr class="no-counter">
<td>Master/Skipper</td>
<td> </td>
</tr>
</table>
</td>
<td>
<table class="table headingTable">
<tr class="no-counter">
<th colspan="2">Boat Crew</th>
</tr>
<tr class="no-counter">
<td nowrap>G.P Crew 1</td>
<td> </td>
</tr>
<tr class="no-counter">
<td nowrap>G.P Crew 2</td>
<td></td>
</tr>
<tr class="no-counter">
<td nowrap>G.P Crew 3</td>
<td></td>
</tr>
<tr class="no-counter">
<td nowrap>G.P Crew 4</td>
<td></td>
</tr>
</table>
</td>
<td>
<table class="table headingTable">
<tr class="no-counter">
<th colspan="4">Passenger Count</th>
</tr>
<tr class="no-counter">
<td colspan="2">Before Departure</td>
<td colspan="2">Before Return</td>
</tr>
<tr class="no-counter">
<td>Divers</td>
<td> </td>
<td>Divers</td>
<td> </td>
</tr>
<tr class="no-counter">
<td>Non Divers</td>
<td> </td>
<td>Non Divers</td>
<td> </td>
</tr>
<tr class="no-counter">
<td>Signed</td>
<td> </td>
<td>Signed</td>
<td> </td>
</tr>
</table>
</td>
<td>
<table class="table headingTable">
<tr class="no-counter">
<th colspan="2">Checks</th>
</tr>
<tr class="no-counter">
<td>Air On & Checked</td>
<td style="text-align: center;"><input type="checkbox"></td>
</tr>
<tr class="no-counter">
<td>BCDs Connected?</td>
<td style="text-align: center;"><input type="checkbox"></td>
</tr>
<tr class="no-counter">
<td>BCDs Inflate?</td>
<td style="text-align: center;"><input type="checkbox"></td>
</tr>
<tr class="no-counter">
<td>Signed</td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<table class="table service-cart">
<tr class="no-counter">
<th>#</th>
<th style="margin:0; padding: 0;">Buddy<br/>Group</th>
<th>Name</th>
<th>Booked</th>
<th>Loc</th>
<th>Last Dive</th>
<th>Air Full</th>
<th>Plan<br/>Depth</th>
<th>Plan<br/>Bottom<br/>Time</th>
<th>Safety<br/>Stop<br/>Time</th>
<th style="padding-left: 5px; padding-right: 5px;">Total<br/>Time</th>
<th style="padding-left: 6px; padding-right: 6px;">Gas<br/>Mix</th>
<th>M.O.D.</th>
<th style="padding-left: 5px; padding-right: 5px;">In<br/>Time</th>
<th style="padding-left: 5px; padding-right: 5px;">Out<br/>Time</th>
<th>Actual<br/>Depth</th>
<th>Actual<br/>Run<br/>Time</th>
<th>Stops<br/>Cmpld</th>
<th style="padding-left: 40px; padding-right: 40px; text-align: left;">Sign for<br/>- Dive Parameters Done<br />- Returned Onboard</th>
</tr>
<#Reference filter="reference_status = 'A'" order="Guest_surname">
<tr style="background-color: #ffffff;">
<td> </td>
<td> </td>
<td class="text-left"><input type="checkbox"></td>
<td> </td>
<td> </td>
<td> </td>
<td class="text-center"><input type="checkbox"></td>
<td style="text-align:right;">M</td>
<td> </td>
<td> </td>
<td> </td>
<td style="text-align:right;">%</td>
<td style="text-align:right;">M</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="text-center"><input type="checkbox"></td>
<td> </td>
</tr>
<tr style="background-color: #ffffff;">
<td> </td>
<td> </td>
<td class="text-left"><input type="checkbox"></td>
<td> </td>
<td> </td>
<td> </td>
<td class="text-center"><input type="checkbox"></td>
<td style="text-align:right;">M</td>
<td> </td>
<td> </td>
<td> </td>
<td style="text-align:right;">%</td>
<td style="text-align:right;">M</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="text-center"><input type="checkbox"></td>
<td> </td>
</tr>
</table>
<hr class="break">
<div class="second">
<img src="/vessellog.png" class="dlog">
</div>
</body>
</html>
CSS:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="styletable.css">
<style>
table tbody tr:not(.no-counter) {
counter-increment: rowNumber;
}
table tbody tr:not(.no-counter) td:nth-child(1)::before {
content: counter(rowNumber);
min-width: 1em;
margin-right: 0.5em;
}
.headingTable {
height: 150px;
font-size: 12px;
width: 100%;
}
.tableWrapper {
width: 100%;
border-collapse: collapse;
}
.second {
transform: rotate(270deg);
margin-left: 180px;
margin-top: -60px;
width: 720px;
height: 1080px;
position: absolute;
}
.dlog {
max-width: 100%;
max-height: 100%;
}
.break {
page-break-after: always;
}
</style>
</head>
To solve my issue what I did was add: <div style="page-break-before:always;"> </div> after the last <table> on first page. This created the page break I needed to print on separate pages. As in:
</table> /* End of First Page */
<div style="page-break-before: always;"> </div>
<div class="vlogimage"> /*Second Page*/
<img class="logologext" alt='<#Business_name>' src= "<#servername>/<#Register_Directory>/<#Splash_Logo>?v=<#now format='yy-mm-dd-hh-nn'>">
<p class="vlogtext"><#Business_name> Daily Vessel Log</p>
<img src="/vessellog.png" class="dlog" >
</div>
I tried applying page-break-before: always; to the first <div> on my second page and this did not work how I was hoping.
Hope this helps someone out there!

Even Odd rows for only one column in tables?

I'm working with tables to display data on a webpage.
Right now I've got even odd for <tr> to have the rows alternating colors. However, I am going to be freezing the 1st column of the table and having the remaining columns scroll to the left and right.
At the moment, the columns that are scrolling to the left are being seen under the frozen column. If I apply a background color to the cells in the frozen column, the columns that are no longer to be displayed when scrolled to the left are then truly hidden.
I'm calling the first column's cells by using td:nth-child(1).
The problem is that I am using alternating row colors so assigning a background color to td:nth-child(1) makes all cells in that 1st row the same color.
Is it possible to add (odd) and (even) to the nth-child call?
I'd like to use a better method (if there is one) than just assigning classes to each of the cells in the first column.
(NOTE: Added my code 02/12/2018)
table.sidebyside {
width: 800px;
overflow-x: scroll;
}
table.sidebyside th:nth-child(1), table.sidebyside td:nth-child(1) {
width: 300px !important;
position:absolute;
}
table.sidebyside th:nth-child(2), table.sidebyside td:nth-child(2) {
padding-left: 300px !important;
}
table.sidebyside th {
background-color: #4b91ea;
height: 63px;
}
table.sidebyside td:nth-child(1) (odd) {
background-color: #fff;
}
table.sidebyside tr:nth-child (even) > td:nth-child(1) {
background-color: rgba(0,0,0,.05);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-md-12">
<div style="width:600px; overflow: auto;">
<table class="sidebyside table table-striped">
<tbody>
<tr>
<th>
</th>
<th>
Bronze-High Deductible
</th>
<th>
Silver-HMO
</th>
<th>
Gold-PPO Low
</th>
<th>
Gold-PPO Med
</th>
</tr>
<tr>
<td>
<b>
Score: </b>
</td>
<td>
<span class="text-green">
95 </span>
</td>
<td>
<span class="text-yellow">
77 </span>
</td>
<td>
<span class="text-danger">
32 </span>
</td>
<td>
<span class="text-danger">
24 </span>
</td>
</tr>
<tr>
<td>
<b>
RealCost: </b>
</td>
<td>
$4,7772.32
</td>
<td>
$6,024.81
</td>
<td>
$8,194.55
</td>
<td>
$8,194.55
</td>
</tr>
<tr>
<td>
<b>
Premiums: </b>
</td>
<td>
$2,400.00
</td>
<td>
$3,100.00
</td>
<td>
$3,956.00
</td>
<td>
$3,956.00
</td>
</tr>
<tr>
<td>
<b>
Cost of Services: </b>
</td>
<td>
$1,575.00
</td>
<td>
$2,239.00
</td>
<td>
$2,983.00
</td>
<td>
$2,983.00
</td>
</tr>
<tr>
<td>
<b>
Cost of Medications: </b>
</td>
<td>
$797.32
</td>
<td>
$927.32
</td>
<td>
$1,198.46
</td>
<td>
$1,198.46
</td>
</tr>
<tr>
<td>
</td>
<td colspan="4">
</td>
</tr>
<tr>
<td>
<b>
Individual Deductible: </b>
</td>
<td>
$3,350.00
</td>
<td>
$3,850.00
</td>
<td>
$4,250.00
</td>
<td>
$4,250.00
</td>
</tr>
<tr>
<td>
<b>
Individual Out of Pocket Maximum: </b>
</td>
<td>
$6,350.00
</td>
<td>
$6,850.00
</td>
<td>
$7,050.00
</td>
<td>
$7,050.00
</td>
</tr>
<tr>
<td>
<b>
Family Deductible: </b>
</td>
<td>
$6,650.00
</td>
<td>
$6,950.00
</td>
<td>
$7,200.00
</td>
<td>
$7,200.00
</td>
</tr>
<tr>
<td>
<b>
Family Out of Pocket Maximum: </b>
</td>
<td>
$12,900.00
</td>
<td>
$13,900.00
</td>
<td>
$15,400.00
</td>
<td>
$15,400.00
</td>
</tr>
<tr>
<td>
<b>
Coinsurance: </b>
</td>
<td>
20%
</td>
<td>
20%
</td>
<td>
30%
</td>
<td>
30%
</td>
</tr>
<tr>
<td>
<b>
Copayment: </b>
</td>
<td>
$25.00
</td>
<td>
$30.00
</td>
<td>
$40.00
</td>
<td>
$40.00
</td>
</tr>
<tr>
<td>
<b>
Pharmacy Generic: </b>
</td>
<td>
$20.00
</td>
<td>
$35.00
</td>
<td>
$45.00
</td>
<td>
$45.00
</td>
</tr>
<tr>
<td>
<b>
Pharmacy Brand: </b>
</td>
<td>
$40.00
</td>
<td>
$45.00
</td>
<td>
$60.00
</td>
<td>
$60.00
</td>
</tr>
<tr>
<td>
<b>
Pharmacy Non Preferred: </b>
</td>
<td>
$60.00
</td>
<td>
$70.00
</td>
<td>
$80.00
</td>
<td>
$80.00
</td>
</tr>
<tr>
<td>
<b>
Mail Order Generic: </b>
</td>
<td>
$60.00
</td>
<td>
$80.00
</td>
<td>
$90.00
</td>
<td>
$90.00
</td>
</tr>
<tr>
<td>
<b>
Mail Order Brand: </b>
</td>
<td>
$80.00
</td>
<td>
$90.00
</td>
<td>
$100.00
</td>
<td>
$100.00
</td>
</tr>
<tr>
<td>
<b>
Mail Order Non Preferred: </b>
</td>
<td>
$120.00
</td>
<td>
$140.00
</td>
<td>
$175.00
</td>
<td>
$175.00
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
For even use
table tr td:nth-child(even)
And for odd use
table tr td:nth-child(odd)
Moreover, always prefer to use the exact descendants you want to apply your css on to avoid any invalid html markup to be selected by your stylesheets.
https://jsfiddle.net/1b329d8u/2/ is what I was trying to achieve.
table.sidebyside {
width: 800px;
overflow-x: scroll;
}
.sidebyside th:nth-child(1), .sidebyside td:nth-child(1) {
width: 300px !important;
position:absolute;
}
.sidebyside th:nth-child(2), .sidebyside td:nth-child(2) {
padding-left: 300px !important;
}
.sidebyside th {
background-color: #4b91ea;
height: 63px;
}
.sidebyside tr:nth-child(even) > td:nth-child(1) {
background-color: #fff;
}
.sidebyside tr:nth-child(odd) > td:nth-child(1) {
background-color: #f7fafa;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-md-12">
<div style="width:600px; overflow: auto;">
<table class="sidebyside table table-striped">
<tbody>
<tr>
<th></th>
<th>Bronze-High Deductible</th>
<th>Silver-HMO</th>
<th>Gold-PPO Low</th>
<th>Gold-PPO Med</th>
</tr>
<tr>
<td><b>Score: </b></td>
<td><span class="text-green">95 </span></td>
<td><span class="text-yellow">77 </span></td>
<td><span class="text-danger">32 </span></td>
<td><span class="text-danger">24 </span></td>
</tr>
<tr>
<td><b>RealCost: </b></td>
<td>$4,7772.32</td>
<td>$6,024.81</td>
<td>$8,194.55</td>
<td>$8,194.55</td>
</tr>
<tr>
<td><b>Premiums: </b></td>
<td>$2,400.00</td>
<td>$3,100.00</td>
<td>$3,956.00</td>
<td>$3,956.00</td>
</tr>
<tr>
<td><b>Cost of Services: </b></td>
<td>$1,575.00</td>
<td>$2,239.00</td>
<td>$2,983.00</td>
<td>$2,983.00</td>
</tr>
<tr>
<td><b>Cost of Medications: </b></td>
<td>$797.32</td>
<td>$927.32</td>
<td>$1,198.46</td>
<td>$1,198.46</td>
</tr>
<tr>
<td></td>
<td colspan="4"></td>
</tr>
<tr>
<td><b>Individual Deductible: </b></td>
<td>$3,350.00</td>
<td>$3,850.00</td>
<td>$4,250.00</td>
<td>$4,250.00</td>
</tr>
<tr>
<td><b>Individual Out of Pocket Maximum: </b></td>
<td>$6,350.00</td>
<td>$6,850.00</td>
<td>$7,050.00</td>
<td>$7,050.00</td>
</tr>
<tr>
<td><b>Family Deductible: </b></td>
<td>$6,650.00</td>
<td>$6,950.00</td>
<td>$7,200.00</td>
<td>$7,200.00</td>
</tr>
<tr>
<td><b>Family Out of Pocket Maximum: </b></td>
<td>$12,900.00</td>
<td>$13,900.00</td>
<td>$15,400.00</td>
<td>$15,400.00</td>
</tr>
<tr>
<td><b>Coinsurance: </b></td>
<td>20%</td>
<td>20%</td>
<td>30%</td>
<td>30%</td>
</tr>
<tr>
<td><b>Copayment: </b></td>
<td>$25.00</td>
<td>$30.00</td>
<td>$40.00</td>
<td>$40.00</td>
</tr>
<tr>
<td><b>Pharmacy Generic: </b></td>
<td>$20.00</td>
<td>$35.00</td>
<td>$45.00</td>
<td>$45.00</td>
</tr>
<tr>
<td><b>Pharmacy Brand: </b></td>
<td>$40.00</td>
<td>$45.00</td>
<td>$60.00</td>
<td>$60.00</td>
</tr>
<tr>
<td><b>Pharmacy Non Preferred: </b></td>
<td>$60.00</td>
<td>$70.00</td>
<td>$80.00</td>
<td>$80.00</td>
</tr>
<tr>
<td><b>Mail Order Generic: </b></td>
<td>$60.00</td>
<td>$80.00</td>
<td>$90.00</td>
<td>$90.00</td>
</tr>
<tr>
<td><b>Mail Order Brand: </b></td>
<td>$80.00</td>
<td>$90.00</td>
<td>$100.00</td>
<td>$100.00</td>
</tr>
<tr>
<td><b>Mail Order Non Preferred: </b></td>
<td>$120.00</td>
<td>$140.00</td>
<td>$175.00</td>
<td>$175.00</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Thanks #TylerH for the solution. I had to use tr:nth-child(even) > td:nth-child(1) so I could target the 1st column only and use (even) and (odd) at the tr level.

Force an element to take exactly half of available height in print media

I am dynamically creating elements (student bills) on a web page which I want to print.
I want this element to take only half of the total printable height in print media, so that I can print two elements on one page.
But in the picture, It's clear that some part of the third element is appearing on first page, which should actually go on the second page.
How can I force this element (one student's bill) to take exactly half of the height of the page?
<div class="col-md-6">
<div id="page-wrap">
<div style="clear:both"></div>
<div id="customer">
<div id="customer-title">
<table>
<tbody>
<tr>
<td style="text-align:center">
12017 </td>
<td style="text-align:center">
dfsdgf sdgsdg sdgsdg </td>
<td style="text-align:center">
1st </td>
</tr>
<tr>
<td style="text-align:center">
32817 </td>
<td style="text-align:center">
Sarika Godara </td>
<td style="text-align:center">
3rd </td>
</tr>
</tbody>
</table>
</div>
<table id="meta">
<tbody>
<tr>
<td class="meta-head">Bill #</td>
<td>149</td>
</tr>
<tr>
<td class="meta-head">Date</td>
<td id="date">11-08-2017</td>
</tr>
<!--tr>
<td class="meta-head">Amount Due</td>
<td><div class="due">Rs.</div></td>
</tr-->
</tbody>
</table>
</div>
<table id="items">
<tbody>
<tr>
<th colspan="1">Sr.No.</th>
<th colspan="4">Description</th>
<th colspan="1">Detail</th>
<th colspan="1">Sub-total</th>
</tr>
<tr>
<td colspan="1">1
</td>
<td colspan="4"> Tuition Fees(upto September)
</td>
<td colspan="1">2600 + 2750
</td>
<td colspan="1">5350
</td>
</tr>
<tr>
<td colspan="1">2
</td>
<td colspan="4"> AC
</td>
<td colspan="1">2450 + 2450
</td>
<td colspan="1">4900
</td>
</tr>
<tr>
<td colspan="1">3
</td>
<td colspan="4"> Transport Fees(upto September)
</td>
<td colspan="1">1650
</td>
<td colspan="1">1650
</td>
</tr>
<tr>
<td colspan="2" class="blank"> </td>
<td colspan="4" class="total-line">Grand Total</td>
<td class="total-value">
<div id="total">Rs. 11900</div>
</td>
</tr>
<tr>
<td colspan="2" class="blank"> </td>
<td colspan="4" class="total-line">Amount Paid</td>
<td class="total-value">Rs. 0</td>
</tr>
<tr>
<td colspan="2" class="blank"> </td>
<td colspan="4" class="total-line balance">Balance Due</td>
<td class="total-value balance">
<div class="due">Rs. 11900</div>
</td>
</tr>
</tbody>
</table>
<div id="terms">
<h5>Please Note</h5> आपने अपने बच्चे की फीस पेमेंट में बहुत देर कर दी है. कृपया जल्दी से जल्दी भुगतान करें.
</div>
</div>
</div>
Try this
add a div after every 2nd elements with page-break-after property
<div style="page-break-after:always"></div>
page-break-after property sets whether a page break should occur AFTER a specified element
DEMO

How can I create line breaks after <td> and within <table> in HTML?

I'm trying to create line breaks after each instance within a table. How can I go about doing this?
<table width="22%" height="18%" align="right" background='../images/table1.png'>
<center>
<tr width = '25%' height = '75px'>
<td>
<p><b><font face='arial'>Title:</font></font> <i>output</i></font></b></p>
</td>
<td>
<p><b><font face='arial'>Title:</font></font> <i>output</i></font></b></p>
</td>
</tr>
</center>
</table>
For that you have to make structure like following:
<table width="22%" height="18%" align="right" background='../images/table1.png'>
<center>
<td>
<b><font face="arial">Title:</font></b></td> <td><i>output</i>
</td>
</tr>
<tr>
<td>
<b><font face="arial">Title:</font> </b></td> <td> <i>output</i>
</td>
</tr>
</table>
Check Fiddle Here.
Edit:
<tr>
<td>
<b><font face="arial">Title:</font></b></td> <td><i>output</i>
</td>
</tr><p></p>
<tr>
<td>
<b><font face="arial">Title:</font> </b></td> <td> <i>output</i>
</td>
</tr>
Here, try this.
I used this table tutorial and just adjusted it to your code. Here's the HTML:
<table width="22%" height="18%" align="right" background="../images/table1.png">
<center>
<tr>
<td><p><b><font face='arial'>Title:</font></font></td>
<td><i>output</i></td>
</tr>
<tr>
<td><p><b><font face='arial'>Title:</font></font></td>
<td><i>output</i></td>
</tr>
</table>
</center>

Position a HTML table element on top of img element

I want to be able to place an html table on top of a image using css. I want to move my table up so that it looks like the picture below:
This is what I currently have it as:
And I want it to look like this:
This is what my code looks like:
<img src="#Url.Content(" ~/images/sortByDivisionControl_BG2.png ")" width="570">
<table id="locations-table" style="margin:0 auto;">
<thead>
<tr>
<th colspan="3">
Locations
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a>Anchorage, AK</a>
</td>
<td>
<a>Spokane, WA</a>
</td>
<td>
<a>Coburg, OR</a>
</td>
</tr>
<tr>
<td>
<a>Kapolei, HI</a>
</td>
<td>
<a>Toledo, WA</a>
</td>
<td>
<a>Medford, OR</a>
</td>
</tr>
<tr>
<td>
<a>Snohomish, WA</a>
</td>
<td>
<a>Ridgefield, WA</a>
</td>
<td>
<a>Redmond, OR</a>
</td>
</tr>
<tr>
<td>
<a>Kent, WA</a>
</td>
<td>
<a>Bend, OR</a>
</td>
<td>
<a>Portland, OR</a>
</td>
</tr>
</tbody>
</table>
This is what background images are for. I would do this instead:
<table id="locations-table" style="margin:0 auto; background-image: #Url.Content("~/images/sortByDivisionControl_BG2.png")">
You can set z-index also using css.
For information :
Check This