Html table not working on internet explorer - html

My table works perfectly on chrome and firefox but not working on Internet Explorer. Any idea what causes it ?
Could it be the problem about angular.js ? or just I.E renders tables differently ?
Is there any way to fix it ?
<div class="dashboard-container">
<div class="dashboard-container_subcontainer">
<table *ngIf="user && user.therapists" class="table table-bordered">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First name</th>
<th scope="col">Last name</th>
<th scope="col">Email</th>
<th scope="col">Country</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody *ngIf="sortedList">
<tr *ngFor="let therapist of sortedList; let i = index" class="clickable" (click)="toggleRowColor(i); setTherapist(therapist)" [ngClass]="{'border-green': i == selectedRow}">
<th class="smallcolmn" scope="row">{{i+1}}</th>
<td class="biggercolmn">{{therapist.firstName}}</td>
<td class="biggercolmn">{{therapist.lastName}}</td>
<td class="biggercolmn">{{therapist.email}}</td>
<td class="biggercolmn">{{therapist.country}}</td>
<td class="biggercolmn" [ngClass]="{'background-blue': therapist.status === TherapistStatus.REGISTERED, 'background-lightBlue': therapist.status === TherapistStatus.READY_FOR_TEST,
'txt-blue': therapist.status === TherapistStatus.CERTIFIED_FOR_APP}">{{constantService.status[therapist.status]}}</td>
</tr>
</tbody>
<tbody *ngIf="!sortedList">
<tr *ngFor="let therapist of therapistList; let i = index" class="clickable" (click)="toggleRowColor(i); setTherapist(therapist)" [ngClass]="{'border-green': i == selectedRow}">
<th class="smallcolmn" scope="row">{{i+1}}</th>
<td class="biggercolmn">{{therapist.firstName}}</td>
<td class="biggercolmn">{{therapist.lastName}}</td>
<td class="biggercolmn">{{therapist.email}}</td>
<td class="biggercolmn">{{therapist.country}}</td>
<td class="biggercolmn" [ngClass]="{'background-blue': therapist.status === TherapistStatus.REGISTERED, 'background-lightBlue': therapist.status === TherapistStatus.READY_FOR_TEST,
'txt-blue': therapist.status === TherapistStatus.CERTIFIED_FOR_APP}">{{constantService.status[therapist.status]}}</td>
</tr>
</tbody>
</table>
</div>
<app-info-container *ngIf="therapist && isOnline" class="infoContainer" (isInfoBoxHidden)='resetSelectedTherapist()' [chosenTherapist] = "therapist"></app-info-container>
<div class="noInternetConnection"*ngIf="!isOnline">No online connection available. Please reconnect.</div>
</div>

Related

edit multiple rows data from text and table using same button in jquery 3.5

I want to enable editing multiple data field after clicking the edit button. There are multiple data need to change. I want to click on a cell (col/row) and that cell value will change to a textbox (editable). After the user edit the value, it will save the each edited data.
Here is the code snippet...
<div class="table-responsive">
<table class="table table-bordered table-dark">
<thead>
<tr>
<th scope="col">Personal Account</th>
<th scope="col">Beginning</th>
<th scope="col">End</th>
<th scope="col">Returns*</th>
<th scope="col">S&P 500***</th>
<th scope="col">Nasdaq***</th>
</tr>
</thead>
<tbody>
<tr class="table-primary input-data">
<td>Inception</td>
<td class="start-date" readonly='readonly'>7/31/2008</td>
<td class="end-date" readonly='readonly'>12/1/2022</td>
<td>22.69%</td>
<td>15.69%</td>
<td>27.87%</td>
</tr>
<tr class="table-primary input-data">
<td>Last 12 months</td>
<td class="start-date">12/31/2021</td>
<td class="end-date">12/1/2022</td>
<td>-31.90%</td>
<td>-15.99%</td>
<td>-29.41%</td>
</tr>
<tr class="table-primary input-data">
<td>Last 3 years</td>
<td class="start-date">12/31/2019</td>
<td class="end-date">12/1/2022</td>
<td>15.39%</td>
<td>9.10%</td>
<td>9.72%</td>
</tr>
<tr class="table-primary input-data">
<td>Last 5 years</td>
<td class="start-date">12/31/2017</td>
<td class="end-date">12/1/2022</td>
<td>14.95%</td>
<td>10.85%</td>
<td>13.71%</td>
</tr>
</tbody>
</table>
</div>
I want to use the latest version of jquery and ajax.
$('#edit-record').click(function() {
$(this).hide();
$('#save-data, #cancel').show();
if (edit-record {
$(this).prop('contenteditable', true).css({
'background': '#fff',
'color': '#000'
})
} else {
$(this).prop('contenteditable', false).removeAttr("style");
}
});
$('#cancel').click(function() {
$('#edit-record').show();
$('#save-data, #cancel').hide();
});
$('#save-data').click(function() {
$(this).hide();
$('#cancel').hide();
$('#edit-record').show();
});

React table optimization problem(HTML,CSS)

I am making a simple web page using React and I need a table on this page. The contents of the table are OK, but the table is not properly aligned. I do not see any problem in the code. How Can I Solve This?
import React from 'react'
const StuffList = () => {
return (
<div className='list-group'>
<table className="table table-hover table-danger"></table>
<thead>
<tr className="bg-primary">
<th scope="col">T.C</th>
<th scope="col">Name</th>
<th scope="col">Surname</th>
<th scope="col">City</th>
<th scope="col">Jobe</th>
<th scope="col">Salary</th>
<th scope="col">Hobbies</th>
<th scope="col">U.Graduate</th>
<th scope="col">Graduate</th>
<th scope="col">P.Graduate</th>
<th scope="col">Blood Group</th>
<th scope="col">Edit</th>
<th scope="col">Delete</th>
<th scope="col">Details</th>
</tr>
</thead>
<tbody>
<tr>
<td>2826572</td>
<td>Mike</td>
<td>White</td>
<td>Kansas</td>
<td>Student</td>
<td>41</td>
<td>Parachute</td>
<td>no</td>
<td>no</td>
<td>no</td>
<td>ARH-</td>
<td><button className='btn btn-warning'>Update</button></td>
<td><button className='btn btn-danger'>Delete</button></td>
<td><button className='btn btn-info'>Details</button></td>
</tr>
</tbody>
</div>
)
}
export default StuffList
you can give the <tr style={{width:"100%",padding:"8px"}}> and for tds you can add
<td style={{padding:"8px}}>
if it didn't worked give the table and its parent div 100% width

colspan not getting applied to column of table

I am building an UI in angular application and need to do colspan for column called Subscriptions highlighted in the screenshot below. I tried applying colspan but doest seem to take effect.
What I need is something like this
Html
<tr>
<th class="tableItem bold">Legal Class Name</th>
<th class="tableItem bold">Last Edited</th>
<th class="tableItem bold">Legal Class ID</th>
<th class="tableItem bold"></th>
<th class="tableItem bold">TERMS</th>
<th class="tableItem bold">SUBSCRIPTIONS</th>
<th class="tableItem bold">Primary Currency</th>
</tr>
<ng-container>
<!-- <tr *ngFor="let f of fundClass['LegalFundClassDetailsViewModel'] | keyvalue"> -->
<tr *ngFor="let f of LegalFundClasses.LegalFundClassDetailsViewModel">
<td class="tableItem">{{f.Description}}</td>
<td class="tableItem"></td>
<td class="tableItem">{{f.Id}}</td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td colspan="5" class="tableItem"></td>
<td class="tableItem">
<kendo-dropdownlist style="width:100%" [(ngModel)]="f.CurrencyId"
class="form-control form-control-sm" [data]="Currencies"
[filterable]="false" textField="CURRENCY_NAME" [valuePrimitive]="true" valueField="CURRENCY_ID">
</kendo-dropdownlist>
</td>
</tr>
</ng-container>
</table>
What gets generated on on inspect of the element . I have shared it across three screenshots as it was difficult to capture in one
Screenshot 1 - The header section
Screenshot 2 - The row section - Expanded
Screenshot 3 - The row section - Collapsed
Screenshot 4 of the entire table in collapsed view
Edit
I have tried the pseudo code suggested by #cpcolella in angular but need to display as seen in the screenshot above in the post
So It should display
Legal Class Name Class A Class B Class C in one row
<div *ngIf="LegalFundClasses && LegalFundClasses.LegalFundClassDetailsViewModel && ColumnNames">
<table class="fundClassesTable table-striped">
<tr *ngFor="let c of ColumnNames">
<th class="tableItem bold">{{ c }}</th>
<ng-container *ngFor="let f of LegalFundClasses.LegalFundClassDetailsViewModel">
<td class="tableItem" *ngIf="c == ColumnNames[0]">{{f.Description}}</td>
<td class="tableItem" *ngIf="c == ColumnNames[1]">{{f.AuditSummary}}</td>
<td class="tableItem" *ngIf="c == ColumnNames[2]">{{f.Id}}</td>
</ng-container>
</tr>
</table>
</div>
</div>
Output of the logic above
You are generating the code wrong. I don't use angular, but the final table structure should look like this:
<table>
<tr>
<th class="tableItem bold">Legal Class Name</th>
<th class="tableItem">Class B</th>
<th class="tableItem">Class A</th>
<th class="tableItem">Class D</th>
<th class="tableItem">Class B</th>
<th class="tableItem">Class A</th>
<th class="tableItem">Class B1</th>
<th class="tableItem">Class C</th>
</tr>
<tr>
<td class="tableItem bold">Last edited</td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
</tr>
<tr>
<td class="tableItem bold">Legal class ID</td>
<td class="tableItem">123</td>
<td class="tableItem">123</td>
<td class="tableItem">123</td>
<td class="tableItem">123</td>
<td class="tableItem">123</td>
<td class="tableItem">123</td>
<td class="tableItem">123</td>
</tr>
<tr>
<td class="tableItem bold">Subscription</td>
<td colspan = "7"> </td>
</tr>
</table>
I've only generated 3 rows. As you can see, each row has 8 column (like yours), except the last one, that has only 2, with one of them spanning 7 columns.
You should not use a for cycle for generating all rows, as the subscription row is different.
You don't get to choose which direction tr and td go. tr is alwys a row. td and th are always cells that make a new column in that row. colspan lets one td or th take up multiple columns. Your table should prbasbly look something like this (though I am also not familiar with angular).
table {
border-collapse: collapse;
width: 100%;
}
table, td {
border: 1px solid black;
text-align: center;
padding: 5px;
}
th {
border: 1px solid black;
text-align: left;
padding: 5px;
}
tr:hover {background-color: #EFF3FB;}
td:nth-child(odd) {background-color: #E7EFFE;}
<table style="border-style: solid; border-width: 1px; padding: 25px;">
<tr>
<th class="tableItem bold">Legal Class Name</th>
<td class="tableItem">Class B</td>
<td class="tableItem">Class A</td>
<td class="tableItem">Class D</td>
<td class="tableItem">Class B</td>
<td class="tableItem">Class A</td>
<td class="tableItem">Class B1</td>
<td class="tableItem">Class C</td>
</tr>
<tr>
<th class="tableItem bold">Last edited</th>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
<td class="tableItem"></td>
</tr>
<tr>
<th class="tableItem bold">Legal class ID</th>
<td class="tableItem">11166</td>
<td class="tableItem">11167</td>
<td class="tableItem">13714</td>
<td class="tableItem">13717</td>
<td class="tableItem">13713</td>
<td class="tableItem">13716</td>
<td class="tableItem">13715</td>
</tr>
<tr>
<th class="tableItem bold">Subscription</th>
<td colspan = "7"> </td>
</tr>
</table>
https://stackoverflow.com/a/31408141/7724517
EDIT:
You'll need to have two loops. One through all of the horizontal headings and their associated field in the LegalClass object (outer) and one through all of the legal class objects (inner). The outer one will put the header item in first (for example: Legal Class Name) and the inner one will put the values for each legal class (in this example, the description). I hope this makes sense. This pseudo code is sort of like python.
FieldNames = {'Legal Class Name':'Description', 'Last Edited':'', 'Legal Class ID':'Id', 'TERMS':'', 'SUBSCRIPTIONS':'', 'Primary Currency':'CurrencyId'}
html = ""
foreach Field in FieldNames:
html += "<tr> <th class="tableItem bold">Field.Key</th>"
foreach LegalClass in LegalClassList:
html += "<td class="tableItem">LegalClass.Field.Value</td>""
html += "</tr>"
EDIT 2:
Something like this maybe. Again, I'm not proficient with angualar.
<table>
<ng-container>
<tr *ngFor="let Row of Rows">
<th class="tableItem bold">{{ Row.Header }}</th>
<td *ngFor="let LFC of LegalFinancialClass" class="tableItem"> {{ LFC.Row.Value }} </td>
</tr>
</ng-container>
</table>

Issues when try to apply css class on rows

I've got this table:
<table id="mytable" st-safe-src="dataSetREST" st-table="displayed" class="table table-responsive portlet-body panel-body">
<thead>
<tr >
<th >A</th>
<th >B</th>
<th >C</th>
<th >D</th>
<th >E</th>
<th >F</th>
<th >G</th>
<th >H</th>
</tr>
</thead>
<tbody data-ng-dblclick="scrollTo()">
<tr data-ng-repeat="row in displayed" st-select-row="row" st-select-mode="single" data-ng-class="{'selected':$index == selectedRow}" data-ng-click="setClickedRow($index)">
<td data-ng-click="$parent.selData(row);">{{$index}}</td>
<td data-ng-click="$parent.selData(row);">{{row.asd}}</td>
<td data-ng-click="$parent.selData(row);">{{row.sad}}</td>
<td data-ng-click="$parent.selData(row);">{{row.dsa}}</td>
<td data-ng-click="$parent.selData(row);">{{row.das}}</td>
<td data-ng-click="$parent.selData(row);">{{row.sda}}</td>
<td data-ng-click="$parent.selData(row);">{{row.ads}}</td>
<td data-ng-click="$parent.selData(row);">{{row.etc}}</td>
</tr>
</tbody>
</table>
I need to apply a background color on the selected row. In the controller I added this:
$scope.selectedRow = null;
$scope.setClickedRow = function(index){
$scope.selectedRow = index;
}
It should work since in data-ng-click I send the index to the method, but it didn't enter the method (or at least didnt print a console.log() placed inside). Here the css class:
.selected {
background-color: #67BBED;
}
check this fiddle it's working great http://jsfiddle.net/linkolen/tq31h4bw/#base
angular.module('myApp', []);
function TestCtrl($scope) {
$scope.selectedRow = null;
$scope.displayed = [{asd:3},{asd:3},{asd:3},{asd:3},{asd:3},{asd:3}]
$scope.setClickedRow = function(index){
$scope.selectedRow = index;
}
}
.selected {
background-color: #67BBED;
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="TestCtrl">
<table id="mytable" st-safe-src="dataSetREST" st-table="displayed" class="table table-responsive portlet-body panel-body">
<thead>
<tr >
<th >A</th>
<th >B</th>
<th >C</th>
<th >D</th>
<th >E</th>
<th >F</th>
<th >G</th>
<th >H</th>
</tr>
</thead>
<tbody data-ng-dblclick="scrollTo()">
<tr data-ng-repeat="row in displayed" st-select-row="row" st-select-mode="single" data-ng-class="{'selected':$index == selectedRow}" data-ng-click="setClickedRow($index)">
<td data-ng-click="$parent.selData(row);">{{$index}}</td>
<td data-ng-click="$parent.selData(row);">{{row.asd}}</td>
<td data-ng-click="$parent.selData(row);">{{row.sad}}</td>
<td data-ng-click="$parent.selData(row);">{{row.dsa}}</td>
<td data-ng-click="$parent.selData(row);">{{row.das}}</td>
<td data-ng-click="$parent.selData(row);">{{row.sda}}</td>
<td data-ng-click="$parent.selData(row);">{{row.ads}}</td>
<td data-ng-click="$parent.selData(row);">{{row.etc}}</td>
</tr>
</tbody>
</table>
<div>
You can use ternary operator in expressions. Just give a try
<tr data-ng-repeat="row in displayed" st-select-row="row" st-select-mode="single" data-ng-click="selectedRow = $index" data-ng-class="$index == selectedRow ? 'selected' : ' '" >
I think your ng-click works later and you're applying class first.

Pagination doesn't work on smart-table when using data from a REST service

So I got a smart-table, which gets the data from a REST service and displays it. When I try to add pagination the application show errors in the html code, saying all attributes needed on pagination are not allowed there.
Here is my actual code for the table:
<table id="mytable" st-safe-src="dataSet" st-table="displayed" class="table table-responsive portlet-body panel-body">
<thead>
<tr >
<th >A COLUMN</th>
<th >A COLUMN</th>
<th >A COLUMN</th>
<th >A COLUMN</th>
<th >A COLUMN</th>
</tr>
</thead>
<tbody data-ng-dblclick="scrollTo()">
<tr data-ng-repeat="row in displayed" st-select-row="row" st-select-mode="single" data-ng-click="$parent.setClickedRow($index)" and data-ng-class="{'selected':$index == $parent.selectedRow}">
<td data-ng-click="$parent.selData(row);">{{$index}}</td>
<td data-ng-click="$parent.selData(row);">{{row.asd}}</td>
<td data-ng-click="$parent.selData(row);">{{row.dsa}}</td>
<td data-ng-click="$parent.selData(row);">{{row.qwe}}</td>
<td data-ng-click="$parent.selData(row);">{{row.ewq}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-center">
<div st-pagination="" st-items-by-page="20" st-displayed-pages="7"></div>
</td>
</tr>
</tfoot>
</table>
After tons of changes finally I made it work, I post the table code if someone needs it.
<div class="smart-table-container">
<table id="mytable" st-safe-src="dataSet" st-table="displayed" class="smart-table table">
<thead>
<tr >
<th >A COLUMN</th>
<th >A COLUMN</th>
<th >A COLUMN</th>
<th >A COLUMN</th>
<th >A COLUMN</th>
</tr>
</thead>
<tbody data-ng-dblclick="scrollTo()">
<tr data-ng-repeat="row in displayed" st-select-row="row" st-select-mode="single" data-ng-click="$parent.setClickedRow($index)" and data-ng-class="{'selected':$index == $parent.selectedRow}">
<td data-ng-click="$parent.selData(row);">{{$index}}</td>
<td data-ng-click="$parent.selData(row);">{{row.asd}}</td>
<td data-ng-click="$parent.selData(row);">{{row.dsa}}</td>
<td data-ng-click="$parent.selData(row);">{{row.qwe}}</td>
<td data-ng-click="$parent.selData(row);">{{row.ewq}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center" st-pagination="" st-items-by-page="5" colspan="8">
</td>
</tr>
</tfoot>
</table>
</div>
While using st-safe-src . The repeater should be on st-table not on st-safe-src.
Pagination works fine then.
if you have only one page in your dataset, the pagination will not show. how many items itemList does have ?
Please try with more items; worked for me.