How to fix the positioning of scroll bar using css - html

I have a table:- HTML Code
<div class="table-scroll">
<table class="my-table" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>firstName</th>
<th>lastName</th>
<th>age</th>
<th>email</th>
<th>balance</th>
<th>Mode</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in rowCollection" ng-class-even="'striped'">
<td>{{row.Row1}}-{{row.Row2}}</td>
<td>{{row.Row3 != null ? row.Row3 : " "}}</td>
<td><div class="width">{{row.Row4 != null ? row.Row4 : " "}}</div></td>
<td>{{row.Row5 != null ? (row.Row2 >= "50"? row.Row5 : (row.Row5 | date:'dd-MMM-yyyy')) : " "}}</td>
<td>{{row.Row2}}</td>
<td>{{row.Row5}}</td>
</tr>
</tbody>
</table>
</div>
CSS Code:-
.table-scroll {
overflow-x: scroll;
overflow-y:hidden;
height:60vh;}
.width{
width:50%;
}
.my-table {
width: 100%; }
.my-table tbody tr {
outline: none; }
.my-table tbody, thead {
display: block; }
.my-table tbody{
overflow-y:scroll;
max-height:50vh;
}
.my-table td {
min-width: 90px;
font-size: .7em;
padding: 6px;
text-align: center;
border-bottom: 1px solid #ddd; }
.my-table th {
min-width: 90px;
background-color: #58595b;
font-size: .7em;
color: #ddd;
padding: 6px;
border-bottom: 1px solid #777;
font-weight: bold;
border-right: 1px solid #333;
border-left: 1px solid #777;
text-align: center; }
.striped {
background-color: #eeeff1; }
JS Code:-
angular.module('myApp', ['smart-table','lrDragNDrop'])
.controller('mainCtrl', ['$scope', '$timeout',
function ($scope, $timeout) {
var nameList = ['Pierre', 'Pol', 'Jacques', 'Robert', 'Elisa'];
var familyName = ['Dupont', 'Germain', 'Delcourt', 'bjip', 'Menez'];
$scope.isLoading = false;
$scope.rowCollection = [];
function createRandomItem() {
var
firstName = nameList[Math.floor(Math.random() * 4)],
lastName = familyName[Math.floor(Math.random() * 4)],
age = Math.floor(Math.random() * 100),
email = firstName + lastName + '#whatever.com',
balance = Math.random() * 3000;
return {
Row1: firstName,
Row2: lastName,
Row3: age,
Row4: email,
Row5: balance
};
}
$scope.columns=['Row1','Row2','Row3','Row4','Row5'];
for(var i=0;i<50;i++){
$scope.rowCollection.push(createRandomItem());
}
}
]);
https://plnkr.co/edit/YCXMSjAQ4VVSyvVFNLoI?p=preview
Here I am trying to fix the column headers and applying the vertical scroll to my tbody.
But the scroll appears at the very end when user scrolls through the horizontal scroll. I am trying to fix the position of vertical scroll but it changes my table look. Also, to achieve above I used display:block to tbody and thead but that ruins the alignment of columns. Can anybody please help me fixing the above issue.

.my-table tbody, thead {display: inline-block; }
.my-table th {min-width:92px;}

Related

Table toggle not working in Safari... works fine in Chrome

I have a simple table that also has a td that is offset and acts as a toggle. It switches between 3 states and is working fine in Chrome. Can anyone help me and explain why it does not currently work in Safari, I have not tested this in other browsers yet, but would like solution to work in other browsers too.
Pic and code attached.
Thank you for any help and solutions.
M.
highlight {
background-color: #86C440;
color: white;
}
th {
font-size: 30px;
}
tr {
text-align: left;
}
td {
font-size: 20px;
background-color: #d4d6d3;
cursor: pointer;
}
.center {
margin-left: auto;
margin-right: auto;
}
tr {
position:relative;
transform:scale(1,1);
}
td.last{
position:fixed;
border: 5px solid #d4d6d3;
background-color: #4eafef;
left: -46px;
top: -46px;
height: 7px;
width: 7px;
line-height: 7px;
cursor: pointer;
}
<html>
<body>
<div id="switch">1</div>
<br><br><br><br><br><br><br><br>
<style>
table {border-collapse: collapse; border: 5px solid white; padding: 5px;}
table td {text-align: center; color: black; border: 5px solid white; padding: 10px; height: 66px; width: 66px;}
</style>
<table class="center">
<tr>
<td>1</td>
<td>2</td>
<td id="toggle" class="last" onclick="toggle1()"></td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>5</td>
<td>6</td>
</tr>
</table>
</body>
<script>
function toggle1() {
var key = document.getElementById("switch").innerHTML;
if (key == 1) {
document.getElementById("toggle").style.backgroundColor = "white";
document.getElementById("toggle").style.backgroundImage = "url('')";
document.getElementById("toggle").style.borderStyle = "solid";
document.getElementById("toggle").style.borderColor = "#d4d6d3";
document.getElementById("toggle").style.borderWidth = "5px";
document.getElementById("switch").innerHTML = 2;
//console.log("toggle clicked 1st time!");
} else if (key == 2) {
document.getElementById("toggle").style.backgroundColor = "#a370f0";
document.getElementById("toggle").style.backgroundImage = "url('')";
document.getElementById("toggle").style.borderStyle = "solid";
document.getElementById("toggle").style.borderColor = "#d4d6d3";
document.getElementById("toggle").style.borderWidth = "5px";
document.getElementById("switch").innerHTML = 3;
//console.log("toggle clicked 2nd time!");
} else if (key == 3) {
document.getElementById("toggle").style.backgroundColor = "#4eafef";
document.getElementById("toggle").style.backgroundImage = "url('')";
document.getElementById("toggle").style.borderStyle = "solid";
document.getElementById("toggle").style.borderColor = "#d4d6d3";
document.getElementById("toggle").style.borderWidth = "5px";
document.getElementById("switch").innerHTML = 1;
//console.log("toggle clicked 3rd time!");
}
}
</script>
</html>
There are a few problems which seem to result in Chrome/Edge behaving differently from Safari.
There is a style declaration within the body rather than the head element. This is picked up by an HTML validator as illegal HTML. The snippet below moves it to the head.
There is a setting for tr elements which implements a transform. This seems to encourage Chrome to position the fixed element relative to the table start rather than relative to the viewport. I don't have a full explanation for this other than to note that any sort of transform seems to result in this behaviour and that any transform will create a new stacking context.
There is a 3rd cell in the first row but not in the subsequent rows. This is picked up as a warning by the validator. I do not know how the table's layout is supposed to look in this circumstance, but of course the result is complicated by the fixed setting which takes the 3rd cell out of the flow visually.
This snippet takes the 3rd cell out and puts a button before the table instead. Together with the other changes Safari and Chrome/Edge now behave the same, with Safari doing the expected behavior on border-collapse.
The button's position needs working on - perhaps the button plus table should be in a container which gets positioned? It depends on exactly what is required in terms of fixing its position.
<!doctype html>
<html>
<head>
<style>
highlight {
background-color: #86C440;
color: white;
}
th {
font-size: 30px;
}
tr {
text-align: left;
}
td {
font-size: 20px;
background-color: #d4d6d3;
cursor: pointer;
}
.center {
margin-left: auto;
margin-right: auto;
}
/* REMOVED
tr {
position:relative;
transform:scale(1, 1);
}
*/
#toggle {
position: fixed;
border: 5px solid #d4d6d3;
background-color: #4eafef;
/* REMOVED
left: -46px;
top: -46px;
*/
/* values changed */
height: 30px;
width: 30px;
rline-height: 7px;
cursor: pointer;
}
</style>
<!-- MOVED FROM body -->
<style>
table {
border-collapse: collapse;
border: 5px solid white;
padding: 5px;
}
table td {
text-align: center;
color: black;
border: 5px solid white;
padding: 10px;
height: 66px;
width: 66px;
}
</style>
</head>
<body>
<div id="switch">1</div>
<br><br><br><br><br><br><br><br>
<div class="container">
<button id="toggle" class="last" onclick="toggle1()"></button>
<table class="center">
<tbody>
<tr>
<td>1</td>
<td>2</td>
<!-- td last removed -->
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>5</td>
<td>6</td>
</tr>
</tbody>
</table>
</div>
<script>
function toggle1() {
var key = document.getElementById("switch").innerHTML;
if (key == 1) {
document.getElementById("toggle").style.backgroundColor = "white";
document.getElementById("toggle").style.backgroundImage = "url('')";
document.getElementById("toggle").style.borderStyle = "solid";
document.getElementById("toggle").style.borderColor = "#d4d6d3";
document.getElementById("toggle").style.borderWidth = "5px";
document.getElementById("switch").innerHTML = 2;
//console.log("toggle clicked 1st time!");
} else if (key == 2) {
document.getElementById("toggle").style.backgroundColor = "#a370f0";
document.getElementById("toggle").style.backgroundImage = "url('')";
document.getElementById("toggle").style.borderStyle = "solid";
document.getElementById("toggle").style.borderColor = "#d4d6d3";
document.getElementById("toggle").style.borderWidth = "5px";
document.getElementById("switch").innerHTML = 3;
//console.log("toggle clicked 2nd time!");
} else if (key == 3) {
document.getElementById("toggle").style.backgroundColor = "#4eafef";
document.getElementById("toggle").style.backgroundImage = "url('')";
document.getElementById("toggle").style.borderStyle = "solid";
document.getElementById("toggle").style.borderColor = "#d4d6d3";
document.getElementById("toggle").style.borderWidth = "5px";
document.getElementById("switch").innerHTML = 1;
//console.log("toggle clicked 3rd time!");
}
}
</script>
<script type="text/javascript">
</script>
</body>
</html>

Can't page break to work without messing up the table formatting

I have been having issues with page breaks in tables. Thought I had a solution as it was working fine in this SO question:
Inserting a page break into of <table> in React app
This worked fine for a table with one column, but nowt that I am working with multiple columns, it is a mess.
Basically I have to include display: block to get the page break to work properly, but that makes it go from a well formatted table to this:
I have gone down the list in MDN just trying anything that might work.
https://developer.mozilla.org/en-US/docs/Web/CSS/display
Furthermore, page breaks are only working when on their own separate <tr> which is undesirable since it generates a blank page. Got this sorted out by moving the pagebreak to the <tr> instead of the <td>.
I haven't been able to resolve these issues; any suggestions on how to approach this problem?
Not sure how useful a JSFiddle will be given the printing issue, but here is the compiled HTML. I can never get JSFiddle working with React:
https://jsfiddle.net/5gz62d91/
Best would probably be the Github repo:
https://github.com/ishraqiyun77/page-breaks
Here is the code separately:
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import styles from '../assets/scss/app.scss';
class PageBreakIssues extends Component {
// Render the data points
renderDataPoint() {
let dataPoint = [];
for (let i = 1; i <= 3; i++) {
let num = (Math.random() * 100).toFixed(2);
dataPoint.push(
<td className='data-point' key={ i }>
{ num < 25 ? null : num }
</td>
)
}
return dataPoint;
}
// Start generating the row data
renderDataRow() {
let dataRow = [];
for (let i = 1; i <= 5; i++) {
dataRow.push(
<tr key={ i }>
<td className='data-name' colSpan='3' key={i}>Test - { i }</td>
{ this.renderDataPoint() }
</tr>
)
}
return dataRow;
}
// Start generating table sections with the section name
// COMMENT THIS OUT TO TRY WITOUT ADDING A BLANK ROW
renderSections() {
let sections = [];
for (let i = 1; i <= 10; i++) {
sections.push(
<tbody key={ i }>
<tr key={ i }>
<td colSpan='7' className='section-name' key={i} >
Section - { i }
</td>
</tr>
{ this.renderDataRow() }
{
i % 2 === 0
?
<tr className='pagebreak'>
<td colSpan='7'></td>
</tr>
:
null
}
</tbody>
)
}
return sections;
}
// Start generating table sections with the section name
// UNCOMMENT THIS SECTION TO TRY WITHOUT INSERT BLANK TR
// renderSections() {
// let sections = [];
// for (let i = 1; i <= 10; i++) {
// sections.push(
// <tbody key={i}>
// <tr key={i}>
// <td colSpan='7' className={ i % 2 === 0? 'section-name pagebreak' : 'section-name'} key={i} >
// Section - {i}
// </td>
// </tr>
// {this.renderDataRow()}
// </tbody>
// )
// }
// return sections;
// }
// Render the table with <th>
render() {
return (
<table>
<thead>
<tr>
<th colSpan='3'>Results</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
{ this.renderSections() }
</table>
)
}
}
ReactDOM.render(<PageBreakIssues />, document.getElementById('app'));
#mixin borders {
border: 1px solid black;
}
%borders {
#include borders;
}
table {
border-spacing: 0;
th {
text-align: center;
}
tr {
th{
#extend %borders;
}
td {
#extend %borders;
&.data-name {
padding: 3px 100px 3px 3px;
}
&.data-point {
text-align: center;
padding: 3px 10px;
}
&.section-name {
background-color: #999;
}
}
}
}
#media print {
tr {
display: block;
}
.pagebreak {
break-before: always !important;
page-break-before: always !important;
page-break-inside: avoid !important;
}
}
I figure out an even more hard-coding method (so call perfectly solve your problem). I must said it is not elegant.
My method's main idea is changing tbody to display:block (as usual), but adding the .pagebreak to target tbody as well.
However, this method unattach tbody from the table and thus no longer align with thead. That's why I add a tr for printing thead, and remove the origin thead when print.
Added printing th, don't show in normal view
//Thead part, add a printing thead only shown in Print
//As originaly thead will has alloction problem
{ i % 2 === 1 ?
<tr className='printing-thead'>
<td colspan="3">Results</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr> : null
}
....
...
//Corrected Page break
</tbody>
<tbody class="pagebreak">
<tr>
<td colspan="7"></td>
</tr>
</tbody>
<tbody>
...
Corresponding CSS
table {
border-spacing: 0;
table-layout: fixed;
th {
text-align: center;
}
tr {
th {
#extend %borders;
}
td {
#extend %borders;
&.data-name {
padding: 3px 100px 3px 3px;
}
&.data-point {
text-align: center;
padding: 3px 10px;
}
&.section-name {
background-color: #999;
}
}
}
tr.printing-thead {
display: none;
}
}
#media print {
thead {
display: none;
}
tbody {
display: block;
tr.printing-thead {
display: contents;
font-weight: bold;
text-align: center;
}
}
.pagebreak {
height: 0px;
break-before: always !important;
page-break-before: always !important;
page-break-inside: avoid !important;
td {
display: none;
}
}
}
The JSfiddle.
And the react version
JSfiddle React Version

How to use search option in Powershell HTML output

I want to convert powershell output into HTML format with the search option.
I have HTML with jscript/css which i am trying to add into HTML style in my Powershell code.
The search option is not searching data in page.
HTML code
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
#myInput {
background-image: url('/css/searchicon.png');
background-position: 10px 10px;
background-repeat: no-repeat;
width: 100%;
font-size: 16px;
padding: 12px 20px 12px 40px;
border: 1px solid #ddd;
margin-bottom: 12px;
}
#myTable {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd;
font-size: 18px;
}
#myTable th, #myTable td {
text-align: left;
padding: 12px;
}
#myTable tr {
border-bottom: 1px solid #ddd;
}
#myTable tr.header, #myTable tr:hover {
background-color: #f1f1f1;
}
</style>
</head>
<body>
<h2>My Customers</h2>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.." title="Type in a name">
<table id="myTable">
<tr class="header">
<th style="width:60%;">Name</th>
<th style="width:40%;">Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Germany</td>
</tr>
</table>
<script>
function myFunction() {
var input, filter, table, tr, td, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
</body>
</html>
I want this html format table to get output of command
Get-service.
$services = Get-Service
$FullHTML = $services | select Name,StartType -First 5 | ConvertTo-Html -Fragment
Here's one way to do it:
Replace the entire <table>...</table> section in your HTML with "$table" (no quotes)
Save the code to a text file, say, template.txt
Then you can run the following to produce a searchable HTML page:
$template = Get-Content ".\template.txt" -Raw
$table = (Get-Service | select Name,StartType | ConvertTo-Html -Fragment).Replace('<table>', '<table id="myTable">')
$template.Replace("`$table", $table) | Out-File .\Services.html

Filter table with multiple columns

Just trying to filter a table but also have it filter the number with and without dashes (working) but also search the name and id as well. Its only searching the one column since the index is [0].
How would I have it search all 3 columns? So if I search number or id or name it would filter. Here is the working code I have so far to search number.
<!DOCTYPE html>
<html>
<head>
<style>
* {
box-sizing: border-box;
}
#myInput {
background-image: url('/css/searchicon.png');
background-position: 10px 10px;
background-repeat: no-repeat;
width: 100%;
font-size: 16px;
padding: 12px 20px 12px 40px;
border: 1px solid #ddd;
margin-bottom: 12px;
}
#myTable {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd;
font-size: 18px;
}
#myTable th, #myTable td {
text-align: left;
padding: 12px;
}
#myTable tr {
border-bottom: 1px solid #ddd;
}
#myTable tr.header, #myTable tr:hover {
background-color: #f1f1f1;
}
</style>
</head>
<body>
<h2>Number search</h2>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.." title="Type in a name">
<table id="myTable">
<tr class="header">
<th style="width:60%;">Number</th>
<th style="width:60%;">Name</th>
<th style="width:60%;">ID</th>
</tr>
<tr>
<td>905-373-3333</td>
<td>Mike</td>
<td>4563</td>
</tr>
<tr>
<td>905-333-3333</td>
<td>adam</td>
<td>8963</td>
</tr>
<tr>
<td>416-373-3432</td>
<td>Jim</td>
<td>9363</td>
</tr>
</table>
<script>
function myFunction() {
var input, filter, table, tr, td, i, cleanedFilter;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
cleanedFilter = filter.replace("-","");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
cellContent = td.innerHTML.toUpperCase().replace(/-/g,"");
if (cellContent.indexOf(cleanedFilter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
</body>
</html>
If you want to use a filter for every td available in your rows, you can use the following:
(function(document) {
'use strict';
var LightTableFilter = (function(Arr) {
var _input;
function _onInputEvent(e) {
_input = e.target;
var tables = document.getElementsByClassName(_input.getAttribute('data-table'));
Arr.forEach.call(tables, function(table) {
Arr.forEach.call(table.tBodies, function(tbody) {
Arr.forEach.call(tbody.rows, _filter);
});
});
}
function _filter(row) {
var text = row.textContent.toLowerCase(), val = _input.value.toLowerCase();
row.style.display = text.indexOf(val) === -1 ? 'none' : 'table-row';
}
return {
init: function() {
var inputs = document.getElementsByClassName('light-table-filter');
Arr.forEach.call(inputs, function(input) {
input.oninput = _onInputEvent;
});
}
};
})(Array.prototype);
document.addEventListener('readystatechange', function() {
if (document.readyState === 'complete') {
LightTableFilter.init();
}
});
})(document);
<section class="container">
<input type="search" class="light-table-filter" data-table="order-table" placeholder="Filter">
<table class="order-table table">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Number 2</th>
<th>Number 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Column One</td>
<td>Two</td>
<td>352353</td>
<td>1</td>
</tr>
<tr>
<td>Column Two</td>
<td>Two</td>
<td>4646</td>
<td>2</td>
</tr>
</tbody>
</table>
</section>

CSS Table Column Freeze

Could someone help with this
http://jsfiddle.net/smilepak/8qRQB/4/
<div>
<table>
<tr>
<td class="headcol">Fiddle Options</td>
<td class="long">Created and maintained by Piotr and Oskar. Hosted by DigitalOcean. Special thanks to MooTools community.</td>
<td class="long">QWERTYUIOPASDFGHJKLZXCVBNM</td>
</tr>
<tr>
<td class="headcol">Legal, Credits and Links</td>
<td class="long" style="width:300px">QWERTYUIOPASDFGHJKLZXCVBNM</td>
<td class="long" style="width:300px">QWERTYUIOPASDFGHJKLZXCVBNM</td>
</tr>
<tr>
<td class="headcol">Ajax Requests</td>
<td class="long">QWERTYUIOPASDFGHJKLZXCVBNM</td>
<td class="long">QWERTYUIOPASDFGHJKLZXCVBNM</td>
</tr>
</table>
table {
border-collapse:separate;
border-top: 1px solid grey;
}
td {
margin:0;
border:1px solid grey;
border-top-width:0px;
}
div {
width: 600px;
overflow-x:scroll;
margin-left:10em;
overflow-y:visible;
padding-bottom:1px;
}
.headcol {
position:absolute;
width:10em;
left:0;
top:auto;
border-right: 1px none black;
border-top-width:1px;
/*only relevant for first row*/
margin-top:-3px;
/*compensate for top border*/
}
In firefox, the row border doesn't seem to line up. I want a table where the first column is frozen while the rest is scrollable. All rows are linked up to a single scroll bar so i can use in a loop via Razor view in MVC.
Thanks,
JSBIN: http://jsbin.com/IwisANaX/3/edit
CSS
...
.freeze td:nth-child(1),
.freeze th:nth-child(1) {
background: #ddd;
position: absolute;
width: 20px;
left: 0;
}
.freeze .bottomScroll {
overflow-x: hidden;
margin-left: 20px;
}
...
JS
var ns = $('.newScroll', table),
bs = $('.bottomScroll', table);
ns.scroll(function(){bs.scrollLeft(ns.scrollLeft());});
try using
.headcol {max-width: 10em}
also note that using
.headcol {position: absolute}
makes the cell not to align relatively to the document; that´s why it looks like that
I used this combination of JavaScript and CSS to solve the sticky column issue.
https://jsfiddle.net/5poxyje4/
JS (Commented Section has boostrap compatible code)
var $table = $('.table');
var $fixedColumn = $table.clone().insertBefore($table).addClass('fixed-column');
$fixedColumn.find('th:not(:first-child),td:not(:first-child),.excludeHeader').remove();
$fixedColumn.find('tr').each(function (i, elem) {
if(elem.rowSpan = "1"){
$(this).height($table.find('tr:eq(' + i + ')').height());
}
else{
for (x = i; x <= parseInt(elem.rowSpan); x++) {
var tempHeight = $(this).height() + $table.find('tr:eq(' + x + ')').height();
$(this).height(tempHeight);
}
}
});
//Comments for if you are using bootrap tables
//var $table = $('.table');
//var $fixedColumn = $table.clone().insertBefore($table).addClass('fixed-column');
//$fixedColumn.find('th:not(:first-child),td:not(:first-child),.excludeHeader').remove();
//$fixedColumn.find('tr').each(function (i, elem) {
// $fixedColumn.find('tr:eq(' + i + ') > th:first-child,tr:eq(' + i + ') > td:first-child').each(function (c, cell) {
// if (cell.rowSpan == "1") {
// $(this).height($table.find('tr:eq(' + i + '),tr:not(.excludeRow)').height());
// }
// else {
// for (x = 1; x < parseInt(cell.rowSpan) ; x++) {
// var tempHeight = $(this).height() + $table.find('tr:eq(' + x + ')').height();
// $(this).height(tempHeight);
// }
// }
// $(this).width($table.find('.stickyColumn').first().width());
// });
//});
CSS(Commented section has bootstrap compatible code in my Site.css)
.table-responsive>.fixed-column {
position: absolute;
display: inline-block;
width: auto;
border-right: 1px solid #ddd;
/* used z-index with bootstrap */
/*z-index: 9999;*/
}
/*This media query conflicted with my bootstrap container. I did not use it*/
#media(min-width:768px) {
.table-responsive>.fixed-column {
display: none;
}
}
/*Commented Section for if you are using bootstrap*/
/*.table-responsive>.fixed-column {
position: absolute;
display: inline-block;
width: auto;
border-right: 1px solid #ddd;
background-color:#ffffff;
}*/
This accounts for if a th or a td has a rowspan greater than 1 as well.