Make table auto scroll vertically via HTML & CSS - html

I have a simple bootstrap table that I am trying to have vertically scroll automatically. The reason for this, is that the table will be displayed on a screen and the table could have 10 items in it or 100. So I would like it to auto scroll vertically so the user does not have to do it manually. After it reaches the end, it will just reset and start back from the top...
This is my markup thus far:
<div class="table-responsive" style="height: 700px; overflow: auto;">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th style="text-align: left; font-size: 23px;">#</th>
<th style="text-align: left; font-size: 23px;">Name</th>
<th style="text-align: left; font-size: 23px;">Description</th>
<th style="text-align: left; font-size: 23px;">Date</th>
</tr>
</thead>
<tbody>
<tr class="danger">
<td style="text-align: left; font-size: 16px;">1213</td>
<td style="text-align: left; font-size: 16px;">John Doe</td>
<td style="text-align: left; font-size: 16px;">my short description</td>
<td style="text-align: left; font-size: 16px;">Today's Date</td>
</tr>
</tbody>
</table>
</div>
NOTE: I am hoping this can be achieved with only HTML and CSS.
Any suggestions?

JS (or jQuery) is needed to get the actual element height and scrollHeight and perform the animation on those values
var $el = $(".table-responsive");
function anim() {
var st = $el.scrollTop();
var sb = $el.prop("scrollHeight")-$el.innerHeight();
$el.animate({scrollTop: st<sb/2 ? sb : 0}, 4000, anim);
}
function stop(){
$el.stop();
}
anim();
$el.hover(stop, anim);
.table-responsive{
height:180px; width:50%;
overflow-y: auto;
border:2px solid #444;
}.table-responsive:hover{border-color:red;}
table{width:100%;}
td{padding:24px; background:#eee;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr><th>#</th></tr>
</thead>
<tbody>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
<tr><td>5</td></tr>
<tr><td>6</td></tr>
<tr><td>7</td></tr>
<tr><td>8</td></tr>
<tr><td>9</td></tr>
<tr><td>10</td></tr>
</tbody>
</table>
</div>

I highly recommend using using javascript for this. I tried this using CSS only once and then promptly abandoned the idea, but it is theoretically possible. The following demo is not tested on all browsers, has huge compatibility issues, and was the jankiest thing ever on Safari. Moral of the story: use javascript.
#import url(https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css);
.table-responsive {
overflow-x: hidden;
}
table.table {
animation: ani linear 1s alternate infinite;
}
.table-responsive:hover {
overflow: auto;
}
.table-responsive:hover table.table {
animation: none ;
}
#keyframes ani {
0% { margin-left: 0; transform: translate3d(0%, 0, 0);}
25% { margin-left: 0; transform: translate3d(0%, 0, 0);}
75% { margin-left: 100%; transform: translate3d(-100%, 0, 0);}
100% { margin-left: 100%; transform: translate3d(-100%, 0, 0);}
}
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th style="text-align: left; font-size: 23px;">#</th>
<th style="text-align: left; font-size: 23px;">Name</th>
<th style="text-align: left; font-size: 23px;">Description</th>
<th style="text-align: left; font-size: 23px;">Date</th>
<th style="text-align: left; font-size: 23px;">Date</th>
<th style="text-align: left; font-size: 23px;">Date</th>
<th style="text-align: left; font-size: 23px;">Date</th>
<th style="text-align: left; font-size: 23px;">Date</th>
</tr>
</thead>
<tbody>
<tr class="danger">
<td style="text-align: left; font-size: 16px;">1213</td>
<td style="text-align: left; font-size: 16px;">John Doe</td>
<td style="text-align: left; font-size: 16px;">my short description</td>
<td style="text-align: left; font-size: 16px;">Today's Date</td>
<td style="text-align: left; font-size: 16px;">Today's Date</td>
<td style="text-align: left; font-size: 16px;">Today's Date</td>
<td style="text-align: left; font-size: 16px;">Today's Date</td>
<td style="text-align: left; font-size: 16px;">Today's Date</td>
</tr>
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th style="text-align: left; font-size: 23px;">#</th>
<th style="text-align: left; font-size: 23px;">Name</th>
<th style="text-align: left; font-size: 23px;">Description</th>
<th style="text-align: left; font-size: 23px;">Date</th>
</tr>
</thead>
<tbody>
<tr class="danger">
<td style="text-align: left; font-size: 16px;">1213</td>
<td style="text-align: left; font-size: 16px;">John Doe</td>
<td style="text-align: left; font-size: 16px;">my short description</td>
<td style="text-align: left; font-size: 16px;">Today's Date</td>
</tr>
</tbody>
</table>
</div>

The code below will not reset and start back from the top the table as asked in the question, but this will help some future readers who trying to scroll and loop the table rows automatically with a fixed header.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$.fn.infiniteScrollUp=function(){
var self=this,kids=self.children()
kids.slice(20).hide()
setInterval(function(){
kids.filter(':hidden').eq(0).fadeIn()
kids.eq(0).fadeOut(function(){
$(this).appendTo(self)
kids=self.children()
})
},1000)
return this
}
$(function(){
$('tbody').infiniteScrollUp()
})
</script>
<title>infiniteScrollUp</title>
</head>
<body>
<table>
<colgroup><col /><col /><col /><col /><col /><col /></colgroup>
<thead>
<tr><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th><th>f</th></tr>
</thead>
<tbody>
<tr><td>1a</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1b</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1c</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1d</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1e</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1f</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1g</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1h</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1i</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1j</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1k</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1l</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1m</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1n</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1o</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1p</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1q</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1r</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1s</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1t</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1u</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1v</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1w</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1x</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1y</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>1z</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
</tbody>
</table>
</body>
</html>

Related

Correctly positioning a QR code image in an HTML invoice template

"I am working on creating an HTML template for an invoice and am having some difficulty placing the QR code image in the correct location. Specifically, I want the QR code image to appear directly under the invoice information table, but it is not appearing in the desired location.
table {
border-collapse: collapse;
font-family: Arial, sans-serif;
margin: 10px auto;
font-size: 14px;
color: #1e2b40;
}
td,
th {
border: 1px solid gray;
padding: 6px;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
.bold {
font-weight: bold;
}
.contact-info {
font-family: Arial, sans-serif;
font-size: 12px;
float: right;
margin: 1px auto;
font-weight: normal;
}
.contact-info ul {
list-style-type: none;
}
.qr-code {
clear: both;
display: block;
width: 300px;
height: 300px;
margin: 0 auto;
}
.srs.logo {
width: 300px;
height: 150px;
margin: 10px auto;
}
.items-table {
float: left;
padding: 6px;
margin: 10px auto;
border-collapse: collapse;
width: 100%;
}
.items-table th,
.items-table td {
border: 1px solid gray;
padding: 6px;
<header>
<!-- header content goes here -->
<img src="https://drive.google.com/file/d/1mwNaPe8w4Bxn7mkXivmI2dqcwBg4_aog" alt="srs-logo" />
<div class="contact-info" style="list-style-type: none">
<ul>
<li>SARL RO SOLUTION</li>
<li>RC: RC:</li>
<li>NIF: NIF</li>
<li>AI: AI</li>
<li>Phone: Phone:</li>
<li>Email: info#company.com</li>
</ul>
</div>
</header>
<hr style="margin-top: 100px;">
<!-- rest of the page content goes here -->
<table style="float: left;">
<tr>
<td colspan="2" class="center bold">Customer Information</td>
<tr>
<tr>
<td>Customer Name:</td>
<td><<[Customer Name]>></td>
</tr>
<tr>
<td>Customer Address:</td>
<td><<[Customer Address]>></td>
</tr>
<tr>
<td>Customer NIF:</td>
<td><<[Customer NIF]>></td>
</tr>
<tr>
<td>Customer RC:</td>
<td><<[Customer RC]>></td>
</tr>
<tr>
<td>Customer AI:</td>
<td><<[Customer AI]>></td>
<tr>
<td>Telephone:</td>
<td><<[Company AI]>></td>
</tr>
</table>
<table style="float: right; margin: 0 auto">
<tr>
<td colspan="2" class="center bold">Invoice Information</td>
<tr>
<td>Invoice Date:</td>
<td><<[Invoice Date]>></td>
<tr>
<td>Invoice ID:</td>
<td><<[Invoice ID]>></td>
</tr>
</table>
<br style="clear: both;">
<img src="<<[Invoice Date]>>" alt="qr-code">
<br style="clear: both;">
<hr>
<table style="float: left;">
<tr>
<td rowspan="1" class="center bold">Related Sales</td>
<td colspan="" class="center bold">Invoice Information</td>
</table>
<br style="clear: both;">
<hr>
<table class="items-table">
<thead>
<tr>
<th>Item description</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<p class="startifend"><<Start:[invoice_key].[Related invoice_items]>></p>
<tr>
<td><<[description]>></td>
<td><<[quantity]>></td>
<td><<[unit_price]>></td>
<td><<[total_price]>></td>
</tr>
<p class="startifend"><<End>></p>
</tbody>
</table>
<br style="clear: both;">
<hr>
I'm going to presume you have a good reason for using tables over grid/flexbox.
A couple of issues to note. Firstly, be very care to always close your <tr> tags there were many unclosed tags through the code which I've corrected in the below snippet.
Secondly, the behaviour of the QR img tag was completely correct in your example and it was rendering where it should have been. In order to achieve the desired outcome, you want to put your Customer Information and Invoice Information tables inside a parent table.
In short:
<table>
<tr>
<td> <!-- Customer Information Table --> </td>
<td> <!-- Invoice Information Table --> </td>
</tr>
</table>
This will allow you to but the QR img directly underneath the Invoice Information Table inside the same <td> tag.
table {
border-collapse: collapse;
font-family: Arial, sans-serif;
margin: 10px auto;
font-size: 14px;
color: #1e2b40;
}
td,
th {
border: 1px solid gray;
padding: 6px;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
.bold {
font-weight: bold;
}
.contact-info {
font-family: Arial, sans-serif;
font-size: 12px;
float: right;
margin: 1px auto;
font-weight: normal;
}
.contact-info ul {
list-style-type: none;
}
.qr-code {
clear: both;
display: block;
width: 300px;
height: 300px;
margin: 0 auto;
}
.srs.logo {
width: 300px;
height: 150px;
margin: 10px auto;
}
.items-table {
float: left;
padding: 6px;
margin: 10px auto;
border-collapse: collapse;
width: 100%;
}
.items-table th,
.items-table td {
border: 1px solid gray;
padding: 6px;
<header>
<!-- header content goes here -->
<img src="https://drive.google.com/file/d/1mwNaPe8w4Bxn7mkXivmI2dqcwBg4_aog" alt="srs-logo" />
<div class="contact-info" style="list-style-type: none">
<ul>
<li>SARL RO SOLUTION</li>
<li>RC: RC:</li>
<li>NIF: NIF</li>
<li>AI: AI</li>
<li>Phone: Phone:</li>
<li>Email: info#company.com</li>
</ul>
</div>
</header>
<hr style="margin-top: 100px;">
<!-- rest of the page content goes here -->
<table style="border:0; width:100%;">
<tr>
<td style="border:0; vertical-align:top">
<table style="float:left;margin:0">
<tr>
<td colspan="2" class="center bold">Customer Information</td>
</tr>
<tr>
<td>Customer Name:</td>
<td><<[Customer Name]>></td>
</tr>
<tr>
<td>Customer Address:</td>
<td><<[Customer Address]>></td>
</tr>
<tr>
<td>Customer NIF:</td>
<td><<[Customer NIF]>></td>
</tr>
<tr>
<td>Customer RC:</td>
<td><<[Customer RC]>></td>
</tr>
<tr>
<td>Customer AI:</td>
<td><<[Customer AI]>></td>
</tr>
<tr>
<td>Telephone:</td>
<td><<[Company AI]>></td>
</tr>
</table>
</td>
<td style="border:0; vertical-align:top;text-align:right;">
<table style="float:right;">
<tr>
<td colspan="2" class="center bold">Invoice Information</td>
</tr>
<tr>
<td>Invoice Date:</td>
<td><<[Invoice Date]>></td>
</tr>
<tr>
<td>Invoice ID:</td>
<td><<[Invoice ID]>></td>
</tr>
</table>
<br style="clear:both;">
<img src="<<[Invoice Date]>>" alt="qr-code">
</td>
</tr>
</table>
<br style="clear: both;">
<hr>
<table style="float: left;">
<tr>
<td rowspan="1" class="center bold">Related Sales</td>
<td colspan="" class="center bold">Invoice Information</td>
</tr>
</table>
<br style="clear: both;">
<hr>
<table class="items-table">
<thead>
<tr>
<th>Item description</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<p class="startifend"><<Start:[invoice_key].[Related invoice_items]>></p>
<tr>
<td><<[description]>></td>
<td><<[quantity]>></td>
<td><<[unit_price]>></td>
<td><<[total_price]>></td>
</tr>
<p class="startifend"><<End>></p>
</tbody>
</table>
<br style="clear: both;">
<hr>
This should do the trick, added a container to the tables and applied flex box. Remove the margin from the table selector, if you want the tables to go to the left and right edges.
<div style="display:flex;justify-content:space-between;">
<table>
<tr>
<td colspan="2" class="center bold">Customer Information</td>
<tr>
<tr>
<td>Customer Name:</td>
<td><<[Customer Name]>></td>
</tr>
<tr>
<td>Customer Address:</td>
<td><<[Customer Address]>></td>
</tr>
<tr>
<td>Customer NIF:</td>
<td><<[Customer NIF]>></td>
</tr>
<tr>
<td>Customer RC:</td>
<td><<[Customer RC]>></td>
</tr>
<tr>
<td>Customer AI:</td>
<td><<[Customer AI]>></td>
<tr>
<td>Telephone:</td>
<td><<[Company AI]>></td>
</tr>
</table>
<table>
<tr>
<td colspan="2" class="center bold">Invoice Information</td>
<tr>
<td>Invoice Date:</td>
<td><<[Invoice Date]>></td>
<tr>
<td>Invoice ID:</td>
<td><<[Invoice ID]>></td>
</tr>
</table>
</div>
<img style="float:right;" src="<<[Invoice Date]>>" alt="qr-code">

How can I fix this uneven border?

In a table that I've made with HTML and CSS, the first column is of a different height than the rest?
The top of the column is uneven with the others to the right of it.
Do run the code snippet below. The column I'm referring to is the "Date joined / Name / Email" block.
How can I fix this?
My current code looks like this:
<style>.table1 {
border-spacing: 1px;
}
.container {
border: 1px solid black;
margin: 10px;
padding: 10px;
align-content: center;
margin-left: auto;
margin-right: auto;
font-family: Calibri, sans-serif;
font-size: 15px;
}
</style>
<body>
<div class="container">
<h2 style="margin: 11px; height: 37px;"><u>Table Test:</u></h2>
<table class="table1" border="1" style="width:50%">
<tr style="background-color:#D6EAF8">
<td colspan="3" align="center" width="60%" style="height:30px"><b>Main</b></td>
<td colspan="1" align="center" width="10%"><b>Email</b></td>
</tr>
<tr>
<td rowspan="4" align="center">Date joined /<br> Name / Email</td>
</tr>
<tr>
<td align="center">05022022</td>
<td style="height:30px" align="center">Kimberly</td>
<td align="center">kimberlyk#gmail.com</td>
</tr>
<tr>
<td align="center">02152022</td>
<td style="height:30px" align="center">Robert</td>
<td align="center">robwayne#gmail.com</td>
</tr>
<tr>
<td align="center">12232021</td>
<td style="height:30px" align="center">Jessie</td>
<td align="center">jessieanderson#gmail.com</td>
</tr>
</table>
</div>
</body>
So you just had a little obfuscation in your colspans/rowspan attributes. Fixing the way you asked wouldn't align your column headers though and have just "Date Joined / Name / Email" centered on their own row though that wasn't very intuitive so I'm assuming you were maybe aiming for something closer to the example provided below. Cheers.
<style>.table1 {
border-spacing: 1px;
}
.container {
border: 1px solid black;
margin: 10px;
padding: 10px;
align-content: center;
margin-left: auto;
margin-right: auto;
font-family: Calibri, sans-serif;
font-size: 15px;
}
</style>
<body>
<div class="container">
<h2 style="margin: 11px; height: 37px;"><u>Table Test:</u></h2>
<table class="table1" border="1" style="width:50%">
<tr style="background-color:#D6EAF8">
<th colspan="2" align="center" width="60%" style="height:30px"><b>Main</b></th>
<th colspan="1" rowspan="2" align="center" width="10%"><b>Email</b></th>
</tr>
<tr>
<td align="center">Date joined</td>
<td align="center">Name</td>
</tr>
<tr>
<td align="center">05022022</td>
<td style="height:30px" align="center">Kimberly</td>
<td align="center">kimberlyk#gmail.com</td>
</tr>
<tr>
<td align="center">02152022</td>
<td style="height:30px" align="center">Robert</td>
<td align="center">robwayne#gmail.com</td>
</tr>
<tr>
<td align="center">12232021</td>
<td style="height:30px" align="center">Jessie</td>
<td align="center">jessieanderson#gmail.com</td>
</tr>
</table>
</div>
</body>

Two div elements in the same line

I am trying to align two <div> tags i the same and I have trying it with inline-block but the elements are not showing up on the same line. Below screenshot shows how it looks like. I am using DataTables so I have a top class.
html
<div class="countFieldCell">
<c:if test="${fn:length(intgList) > 0}">Total: ${fn:length(intgList)}</c:if>
<c:if test="${fn:length(intgList) == 0}">No Data found..</c:if>
</div>
<div class="outerCountSection">
<table id="esignTable" style="width:100%;table-layout:fixed">
<thead>
<tr>
<th align="center" class="fieldLabelCell">Line of Business</th>
<th align="center" width="14%" class="fieldLabelCell">Insured</th>
<th align="center" width="15%" class="fieldLabelCell">Customer<br>Phone</th>
<th align="center" width="16%" class="fieldLabelCell">Policy #</th>
<th align="center" width="19%" class="fieldLabelCell">E-Sign<br>Created Date</th>
<th align="center" class="fieldLabelCell">Customer<br>Email</th>
<th align="center" class="fieldLabelCell" style="text-align: left"># of E-Sign Documents</th>
</tr>
</thead>
<tbody>
CSS
.dataFieldCell {
font: normal 10px Verdana, Arial, Helvetica, sans-serif;
vertical-align: top;
height: 25px;
padding-left: 0px;
}
.top {
display: block;
margin: 0 auto;
margin-right: 31%;
}
.outerCountSection {
background: #EAEAEA;
font: normal 11px Verdana, Arial, Helvetica, sans-serif;
height: 15%;
padding-top: 0.25%;
padding-bottom: 0.15%;
}
You should try <span> (display: inline) it will do the job!
Use the css width property with float attribute. Use padding-top to maintain it on same row.
.countFieldCell{
width:10%;
float:right;
text-align:right;
padding-top:10px;
}
.outerCountSection{
width:90%;
}
<div class="countFieldCell">
<c:if test="${fn:length(intgList) > 0}">Total: 1</c:if>
</div>
<div class="outerCountSection">
<table id="esignTable" style="width:100%;table-layout:fixed">
<thead>
<tr>
<th align="center" class="fieldLabelCell">Line of Business</th>
<th align="center" width="14%" class="fieldLabelCell">Insured</th>
<th align="center" width="15%" class="fieldLabelCell">Customer<br>Phone</th>
<th align="center" width="16%" class="fieldLabelCell">Policy #</th>
<th align="center" width="19%" class="fieldLabelCell">E-Sign<br>Created Date</th>
<th align="center" class="fieldLabelCell">Customer<br>Email</th>
<th align="center" class="fieldLabelCell" style="text-align: left"># of E-Sign Documents</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
.countFieldCell{
float: right;
}

Print only HTML Table from page

I have a page that has a lot of elements on it - Buttons, Tiles, Tables, Lists, etc. I am wanting to only print ONE of the HTML tables when I click my print button.... I am needing to do this via css and html, what is the bets way to accomplish this? I have the following, but this prints the entire page:
CSS
<style media="screen">
.noPrint {
display: block;
}
.yesPrint {
display: block !important;
}
</style>
<style media="print">
.noPrint {
display: none;
}
.yesPrint {
display: block !important;
}
</style>
HTML
<div class="table-responsive yesPrint">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="text-align: left; font-size: 15px;">Number</th>
<th style="text-align: left; font-size: 15px;">Caller</th>
<th style="text-align: left; font-size: 15px;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left; font-size: 13px;">Number</td>
<td style="text-align: left; font-size: 13px;">Name</td>
<td style="text-align: left; font-size: 13px;">Here is the short description</td>
</tr>
</tbody>
</table>
<input type="button" onclick="window.print()"/>
</div>

Table cells expanding in IE when previous row has rowspan?

I have a complicated set of table rows with colspans and rowspans all over the shop. All works fine except for the bottom row in Internet Explorer which forces it's height to be the same as the previous row, which is set to rowspan="2". How can I fix this?
Also, the layout needs to be a table because a PDF generator uses it and that requires tables. Ideally the HTML layout wouldn't change at all, but it can change if it needs to.
Below is the code. Look at it in Google Chrome to see how it should be displaying in IE.
.MhrPayslipDetail {
display: block;
font-family: sans-serif;
font-size: 16px;
padding: 20px 60px;
text-align: center;
}
.MhrPayslipDetail-payslip {
background-color: #fff;
border-collapse: separate;
border-spacing: 10px;
width: 100%;
}
.MhrPayslipDetail-label {
background-color: #c1c1c1;
border: 1px solid #c1c1c1;
border-radius: 5px;
font-weight: bold;
padding: 4px;
text-align: left;
vertical-align: middle;
}
.MhrPayslipDetail-cell,
.MhrPayslipDetail-cellRight {
background-color: #fff;
border: 1px solid #c1c1c1;
border-radius: 5px;
padding: 4px;
text-align: left;
vertical-align: middle;
}
.MhrPayslipDetail-cellRight {
text-align: right;
}
.MhrPayslipDetail-list {
border: 0;
border-collapse: collapse;
width: 100%;
}
.MhrPayslipDetail-listCell,
.MhrPayslipDetail-listLabel,
.MhrPayslipDetail-listCellHeader {
border: 0;
padding: 1px;
text-align: left;
vertical-align: middle;
}
.MhrPayslipDetail-listCellRight,
.MhrPayslipDetail-listCellHeaderRight {
border: 0;
padding: 1px;
text-align: right;
vertical-align: middle;
}
.MhrPayslipDetail-listLabel,
.MhrPayslipDetail-listCellHeader {
font-weight: bold;
width: 50%;
}
.MhrPayslipDetail-details {
font-size: .9em;
}
.MhrPayslipDetail-paymentsDetails,
.MhrPayslipDetail-deductionsDetails {
height: 21em;
vertical-align: top;
}
.MhrPayslipDetail-thisPeriodDetails,
.MhrPayslipDetail-yearToDateDetails {
height: 10em;
vertical-align: top;
}
<div class="MhrPayslipDetail">
<table class="MhrPayslipDetail-payslip">
<tbody>
<tr>
<td colspan="3" rowspan="3" class="MhrPayslipDetail-cell MhrPayslipDetail-paymentsDetails">
<table class="MhrPayslipDetail-details MhrPayslipDetail-list">
<thead>
<tr>
<th class="MhrPayslipDetail-listCellHeader">Description</th>
<th class="MhrPayslipDetail-listCellHeaderRight">U/T</th>
<th class="MhrPayslipDetail-listCellHeaderRight">Rate</th>
<th class="MhrPayslipDetail-listCellHeaderRight">Cash</th>
</tr>
</thead>
<tbody>
<tr>
<td class="MhrPayslipDetail-listCell">Test Basic Pay</td>
<td class="MhrPayslipDetail-listCellRight"></td>
<td class="MhrPayslipDetail-listCellRight"></td>
<td class="MhrPayslipDetail-listCellRight">200.00</td>
</tr>
</tbody>
</table>
</td>
<td colspan="2" rowspan="3" class="MhrPayslipDetail-cell MhrPayslipDetail-deductionsDetails">
<table class="MhrPayslipDetail-details MhrPayslipDetail-list">
<thead>
<tr>
<th class="MhrPayslipDetail-listCellHeader">Description</th>
<th class="MhrPayslipDetail-listCellHeaderRight">Cash</th>
</tr>
</thead>
<tbody>
<tr>
<td class="MhrPayslipDetail-listCell">Tax</td>
<td class="MhrPayslipDetail-listCellRight">25.40</td>
</tr>
<tr>
<td class="MhrPayslipDetail-listCell">NI</td>
<td class="MhrPayslipDetail-listCellRight">24.00</td>
</tr>
</tbody>
</table>
</td>
<td colspan="2" class="MhrPayslipDetail-cell MhrPayslipDetail-thisPeriodDetails">
<table class="MhrPayslipDetail-details MhrPayslipDetail-list">
<thead>
<tr>
<th class="MhrPayslipDetail-listCellHeader">Description</th>
<th class="MhrPayslipDetail-listCellHeaderRight">Cash</th>
</tr>
</thead>
<tbody>
<tr>
<td class="MhrPayslipDetail-listCell">Taxable Pay</td>
<td class="MhrPayslipDetail-listCellRight">200.00</td>
</tr>
<tr>
<td class="MhrPayslipDetail-listCell">Employers National Insurance</td>
<td class="MhrPayslipDetail-listCellRight">27.60</td>
</tr>
<tr>
<td class="MhrPayslipDetail-listCell">Niable Pay</td>
<td class="MhrPayslipDetail-listCellRight">200.00</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th colspan="2" class="MhrPayslipDetail-label">Year-to-date</th>
</tr>
<tr>
<td colspan="2" rowspan="2" class="MhrPayslipDetail-cell MhrPayslipDetail-yearToDateDetails">
<table class="MhrPayslipDetail-details MhrPayslipDetail-list">
<tbody>
<tr>
<td class="MhrPayslipDetail-listCell">Taxable Pay</td>
<td class="MhrPayslipDetail-listCellRight">7,200.00</td>
</tr>
<tr>
<td class="MhrPayslipDetail-listCell">NI</td>
<td class="MhrPayslipDetail-listCellRight">622.08</td>
</tr>
<tr>
<td class="MhrPayslipDetail-listCell">Tax</td>
<td class="MhrPayslipDetail-listCellRight">25.40</td>
</tr>
<tr>
<td class="MhrPayslipDetail-listCell">Niable Pay</td>
<td class="MhrPayslipDetail-listCellRight">7,200.00</td>
</tr>
<tr>
<td class="MhrPayslipDetail-listCell">Employers National Insurance</td>
<td class="MhrPayslipDetail-listCellRight">713.73</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th class="MhrPayslipDetail-label">Payments</th>
<td class="MhrPayslipDetail-cellRight" colspan="2">200.00</td>
<th class="MhrPayslipDetail-label">Deductions</th>
<td class="MhrPayslipDetail-cellRight">49.40</td>
</tr>
</tbody>
</table>
</div>
UPDATE
Since submitting this question I have tried using sub-tables to separate out the columns, however I found that when I did that I wasn't able to get them to line up correctly due to border spacing and the PDF generator's lack of being able to use border-collapse:collapse;.
As an FYI, this is the PDF generator the system is using.