Content moves alone - HTML - html

Can someone explain me why when I toggle the tabs, the content is not aligned horizontally on both tabs?
If you notice, the content table moves to the left when you go to the document.
I can't figure it out why this is happening. Any help?
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="content">
<ul class="nav nav-tabs">
<!-- ngIf: !vm.selectedTicket.customerName1 && !vm.selectedTicket.customerName2 -->
<!-- ngIf: vm.selectedTicket.customerName1 && vm.selectedTicket.customerName2 -->
<li ng-if="vm.selectedTicket.customerName1 && vm.selectedTicket.customerName2" class="ng-scope" style=""><a data-toggle="tab" href="#customer1Content" class="ng-binding" aria-expanded="false"><i class="glyphicon glyphicon-user"></i> Customer 1 Information</a></li>
<!-- end ngIf: vm.selectedTicket.customerName1 && vm.selectedTicket.customerName2 -->
<li class=""><a data-toggle="tab" href="#documentContent" class="ng-binding" aria-expanded="false"><i class="glyphicon glyphicon-file"></i> Document Information</a></li>
</ul>
<div class="tab-content top5">
<!-- ngIf: !vm.selectedTicket.customerName1 && !vm.selectedTicket.customerName2 && vm.selectedTicket.customerName -->
<!-- ngIf: vm.selectedTicket.customerName1 && vm.selectedTicket.customerName2 -->
<div ng-if="vm.selectedTicket.customerName1 && vm.selectedTicket.customerName2" id="customer1Content" class="tab-pane fade ng-scope" style="">
<table class="table ipp-simple-table">
<tbody>
<tr>
<th class="first-no-border ng-binding">Customer Number</th>
<td class="first-no-border ng-binding">333</td>
</tr>
<tr>
<th class="ng-binding">Customer Name</th>
<td class="ng-binding">Name1</td>
</tr>
<tr>
<th class="ng-binding">Birth Date</th>
<td class="ng-binding">08.12.2017</td>
</tr>
<tr>
<th class="ng-binding">Account Number</th>
<td class="ng-binding">123</td>
</tr>
<tr>
<th class="ng-binding">Status</th>
<td>
<!-- ngIf: vm.selectedTicket.status.description == 'New' --><span ng-if="vm.selectedTicket.status.description == 'New'" class="ipp-color ng-scope"><b class="ng-binding">New</b></span>
<!-- end ngIf: vm.selectedTicket.status.description == 'New' -->
<!-- ngIf: vm.selectedTicket.status.description == 'Closed' -->
</td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="ng-binding">Target Ticket
</th>
<td>
<select ng-options="ticket.docid for ticket in vm.tickets" ng-model="vm.selectedTicket" class="ng-pristine ng-untouched ng-valid">
<option label="1" value="object:49">1</option>
<option label="2" value="object:50">2</option>
<option label="3" value="object:51">3</option>
<option label="4" value="object:52">4</option>
<option label="5" value="object:53">5</option>
<option label="6" value="object:54" selected="selected">6</option>
</select>
</td>
</tr>
</tfoot>
</table>
</div>
<!-- end ngIf: vm.selectedTicket.customerName1 && vm.selectedTicket.customerName2 -->
<div id="documentContent" class="tab-pane fade">
<table class="table ipp-simple-table">
<thead>
</thead>
<tbody>
<tr>
<th class="first-no-border ng-binding">Document ID</th>
<td class="first-no-border ng-binding">6</td>
</tr>
<tr>
<th class="ng-binding">Document Date</th>
<td class="ng-binding">05.12.2018</td>
</tr>
<tr>
<th class="ng-binding">Document Type</th>
<td class="ng-binding">9999</td>
</tr>
<tr>
<th class="ng-binding">Description</th>
<td class="w-50 ng-binding">Unkategorisiert</td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="ng-binding">Target Ticket</th>
<td>
<select ng-options="ticket.docid for ticket in vm.tickets" ng-model="vm.selectedTicket" class="ng-pristine ng-untouched ng-valid">
<option label="1" value="object:49">1</option>
<option label="2" value="object:50">2</option>
<option label="3" value="object:51">3</option>
<option label="4" value="object:52">4</option>
<option label="5" value="object:53">5</option>
<option label="6" value="object:54" selected="selected">6</option>
</select>
</td>
</tr>
</tfoot>
</table>
</div>
</div>

Related

How to fix the responsivvness of this calendar table on Bootstrap 5.2?

Here the html code, Also if anyone could, How Could I put a Rounded Border on these tables using bootstrap? I will be really greatful if someone could help me on this situation. I am over typing but the stackoverflow didnt allow me to ask the quention! /snif
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="/assets/css/calendar.css" />
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-2 bg-secondary">
<div class="dropdown">
<button
class="btn btn-primary dropdown-toggle"
type="button"
id="dropdown"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Dropdown
</button>
<ul class="dropdown-menu" aria-labelledby="dropdown">
<li><a class="dropdown-item" href="#">Dropdown item</a></li>
<li><a class="dropdown-item" href="#">Dropdown item</a></li>
<li><a class="dropdown-item" href="#">Dropdown item</a></li>
</ul>
</div>
</div>
<div class="col-md-10 col-xs-12">
<div class="row">
<div class="col-12 col-sm-12 bg-primary">
<!-- Código Calendar -->
<h2>Calendar</h2>
<table class="table text-center table-hover table-bordered table-responsive">
<thead>
<tr class="bg-success">
<th class="col-1" scope="col">#</th>
<th class="col-1" scope="col">Monday</th>
<th class="col-1" scope="col">Tuesday</th>
<th class="col-1" scope="col">Wednesday</th>
<th class="col-1" scope="col">Thursday</th>
<th class="col-1" scope="col">Friday</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">09:00</th>
<td>Mark</td>
<td>Otto</td>
<td>#mdo</td>
<td>Otto</td>
<td>#mdo</td>
</tr>
<tr>
<th scope="row">09:30</th>
<td>Mark</td>
<td>Otto</td>
<td>#mdo</td>
<td>Otto</td>
<td>#mdo</td>
</tr>
<tr>
<th scope="row">10:00</th>
<td>Mark</td>
<td>Otto</td>
<td>#mdo</td>
<td>Otto</td>
<td>#mdo</td>
</tr>
</tbody>
</table>
<!-- Código Calendar -->
</div>
<div class="col-12 col-sm-12 bg-success">
<h2>History</h2>
<table class="table table-dark table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>#mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>#fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>#twitter</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.11.5/dist/umd/popper.min.js"
integrity="sha384-Xe+8cL9oJa6tN/veChSP7q+mnSPaj5Bcu9mPX5F5xIGE0DVittaqT5lorf0EI7Vk"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/js/bootstrap.min.js"
integrity="sha384-kjU+l4N0Yf4ZOJErLsIcvOU2qSb74wXpOhqTvwVx3OElZRweTnQ6d31fXEoRD1Jy"
crossorigin="anonymous"
></script>
</body>
</html>
Here is the image of the problem of the table that doesn't fit on the container!
code img
It looks like you have read the documentation, but didn't understand how to use .table-responsive correctly. If you scroll down, you can see that you need to wrap your table in a .table-responsive like this:
<div class="table-responsive">
<table class="table text-center table-hover table-bordered">
<!-- Content -->
</table>
</div>
As for adding rounded borders, I found this answer that should help. It seems like the problem you will have is bootstrap uses 'border-collapse:collapse' which interferes with the rounded corners.

How to add Rows and Delete Rows to calculate again?

function autoCalcSetup(){
$('form[name=transactions]').jAutoCalc('destroy');
$('form[name=transactions] tr[name=services]').jAutoCalc({keyEventsFire: true, decimalPlaces: 2, emptyAsZero: true});
$('form[name=transactions]').jAutoCalc({decimalPlaces: 2});
}
autoCalcSetup();
$('button[name=remove]').click(function(e){
e.preventDefault();
var form = $(this).parents('form')
$(this).parents('tr').remove();
autoCalcSetup();
});
$('button[name=add]').click(function(e){
e.preventDefault();
var $table = $(this).parents('table');
var $top = $table.find('tr[name=services]').first();
var $new = $top.clone(true);
$new.jAutoCalc('destroy');
$new.insertBefore($top);
$new.find('input[type=text]').val('');
autoCalcSetup();
});
<!DOCTYPE html>
<html lang="en">
<!-- blank.html 21 Nov 2019 03:54:41 GMT -->
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" name="viewport">
<title>I-MED HEALTHCARE</title>
<!-- General CSS Files -->
<link rel="stylesheet" href="assets/css/app.min.css">
<link rel="stylesheet" href="assets/bundles/bootstrap-daterangepicker/daterangepicker.css">
<link rel="stylesheet" href="assets/bundles/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css">
<link rel="stylesheet" href="assets/bundles/select2/dist/css/select2.min.css">
<link rel="stylesheet" href="assets/bundles/jquery-selectric/selectric.css">
<link rel="stylesheet" href="assets/bundles/bootstrap-timepicker/css/bootstrap-timepicker.min.css">
<link rel="stylesheet" href="assets/bundles/datatables/datatables.min.css">
<link rel="stylesheet" href="assets/bundles/datatables/DataTables-1.10.16/css/dataTables.bootstrap4.min.css">
<script src="https://cdn.jsdelivr.net/npm/jautocalc#1.3.1/dist/jautocalc.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- Template CSS -->
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/components.css">
<!-- Custom style CSS -->
<link rel="stylesheet" href="assets/css/custom.css">
<link rel='shortcut icon' type='image/x-icon' href='assets/img/imed.png' />
</head>
<body>
<div class="loader"></div>
<div id="app">
<div class="main-wrapper main-wrapper-1">
<div class="navbar-bg"></div>
<!-- top bar -->
<?php require_once("include/topbar.php"); ?>
<!-- top bar -->
<!-- side bar -->
<?php require_once("include/sidebar.php"); ?>
<!-- side bar -->
<!-- Main Content -->
<div class="main-content">
<section class="section">
<div class="section-body">
<!-- add content here -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3>Patient Transactions</h3>
</div>
<div class="card-body">
<div class="form-group">
<button type="button" class="btn btn-primary" data-toggle="modal"
data-target=".bd-example-modal-xl">Find Patient</button>
</div>
<div class="container">
<form name="transactions">
<table class="table table-hover table-bordered table-striped" name="transactions">
<thead>
<tr>
<th></th>
<th>Item</th>
<th>Quantity</th>
<th>Price</th>
<th>Item Total</th>
</tr>
</thead>
<tbody>
<tr name="services">
<td><button class="btn btn-primary" name="remove">Remove</button></td>
<td>Stuff</td>
<td><input type="text" class="form-control" name="qty" value="3"></td>
<td><input type="text" class="form-control" name="price" value="12"></td>
<td><input type="text" style="text-align:right" class="form-control" name="item_total" jAutoCalc="{qty} * {price}"></td>
</tr>
<tr>
<td colspan="2"> </td>
<td>Subtotal</td>
<td> </td>
<td><input type="text" style="text-align:right" class="form-control" name="subtotal" jAutoCalc="SUM({item_total})"></td>
</tr>
<tr>
<td colspan="2"></td>
<td>Tax</td>
<td>
<select class="form-control" name="tax">
<option value=".06">CT Tax</option>
<option value=".00">Tax Free</option>
</select>
</td>
<td><input type="text" style="text-align:right" class="form-control" name="tax_total" jAutoCalc="{subtotal} * {tax}"></td>
</tr>
<tr>
<td colspan="2"></td>
<td>Total</td>
<td> </td>
<td><input type="text" style="text-align:right" class="form-control" name="grand_total" jAutoCalc="{subtotal} + {tax_total}"></td>
</tr>
<tr>
<td colspan="4"></td>
<td><button class="btn btn-primary" name="add">Add Row</button></td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="text-right">
<button type="submit" class="btn btn-primary btn-icon icon-right" name="save"><i class="fas fa-file-invoice"></i> Process Payment</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
<!-- End of Main Content -->
<!-- FIND PATIENT TABLE MODAL -->
<div class="modal fade bd-example-modal-xl" id="select-patient"tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="myLargeModalLabel">Find Patient</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="section-body">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4> </h4>
</div>
<div class="card-body">
<div class="table-responsive">
<?php
require_once("include/connect.php");
try{
$sql="SELECT patient_id, CONCAT(patient_lname, ', ', patient_fname, ' ', patient_mi) AS Fullname, top, pay_method FROM tbl_patientinfo WHERE isDeleted='0'";
$result=$con->prepare($sql);
$result->execute();
?>
<table class="table table-hover" id="table-1">
<thead>
<tr>
<th class="text-center">
#
</th>
<th>Patient Name</th>
<th>Age</th>
<th>Gender</th>
</tr>
</thead>
<tbody>
<?php while($row=$result->fetch()){ ?>
<tr style="cursor: pointer;">
<td><?php echo $row['patient_id']; ?></td>
<td><?php echo $row['Fullname']; ?></td>
<td><?php echo $row['top']; ?></td>
<td><?php echo $row['pay_method']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php
} catch (PDOException $th){
echo "Error: ".$th->getMessage();
}
$con=null;
?>
<script>
var table = document.getElementById('table-1');
for(var i = 1; i < table.rows.length; i++)
{
table.rows[i].onclick = function()
{
//rIndex = this.rowIndex;
document.getElementById("txt-patient_id").value = this.cells[0].innerHTML;
document.getElementById("txt-patient_name").value = this.cells[1].innerHTML;
document.getElementById("txt-payMethod").value = this.cells[3].innerHTML;
$('#select-patient').modal('hide');
};
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End of FIND PATIENT TABLE MODAL -->
<!-- setting bar -->
<?php require_once("include/settingbar.php"); ?>
<!-- setting bar -->
<!-- footer bar -->
<?php require_once("include/footer.php"); ?>
<!-- footer bar -->
<script type="text/javascript" src="assets/bundles/CRUD/transaction.js"></script>
<!-- General JS Scripts -->
<script src="assets/js/app.min.js"></script>
<script src="assets/bundles/datatables/datatables.min.js"></script>
<script src="assets/bundles/datatables/DataTables-1.10.16/js/dataTables.bootstrap4.min.js"></script>
<!-- JS Libraies -->
<script src="assets/bundles/cleave-js/dist/cleave.min.js"></script>
<script src="assets/bundles/cleave-js/dist/addons/cleave-phone.us.js"></script>
<script src="assets/bundles/jquery-pwstrength/jquery.pwstrength.min.js"></script>
<script src="assets/bundles/bootstrap-daterangepicker/daterangepicker.js"></script>
<script src="assets/bundles/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
<script src="assets/bundles/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
<script src="assets/bundles/select2/dist/js/select2.full.min.js"></script>
<script src="assets/bundles/jquery-selectric/jquery.selectric.min.js"></script>
<script src="assets/bundles/sweetalert/sweetalert.min.js"></script>
<!-- Page Specific JS File -->
<script src="assets/js/page/forms-advanced-forms.js"></script>
<script src="assets/js/page/sweetalert.js"></script>
<script src="assets/js/page/datatables.js"></script>
<!-- Template JS File -->
<script src="assets/js/scripts.js"></script>
<!-- Custom JS File -->
<script src="assets/js/custom.js"></script>
<script src="assets/js/page/sweetalert.js"></script>
</body>
<!-- blank.html 21 Nov 2019 03:54:41 GMT -->
</html>
I have a problem in adding and removing rows. When I type numbers to calculate it using jAutoCalc library, it's working. So I don't have any problem with that. But when I want to add some rows and removing some rows, it shows nothing. And I don't see anything error in my program. But according to Inspects in my Browser (I'm using Microsoft Edge), I have an error in "$new.jAutoCalc('destroy'); " and it says that "$new.jAutoCalc" is not a function.
I use this following codes:
function autoCalcSetup() {
$('form[name=transactions]').jAutoCalc('destroy');
$('form[name=transactions] tr[name=services]').jAutoCalc({
keyEventsFire: true,
decimalPlaces: 2,
emptyAsZero: true
});
$('form[name=transactions]').jAutoCalc({
decimalPlaces: 2
});
}
autoCalcSetup();
$('button[name=remove]').click(function(e) {
e.preventDefault();
var form = $(this).parents('form')
$(this).parents('tr').remove();
autoCalcSetup();
});
$('button[name=add]').click(function(e) {
e.preventDefault();
var $table = $(this).parents('table');
var $top = $table.find('tr[name=services]').first();
var $new = $top.clone(true);
$new.jAutoCalc('destroy'); //this is my error (According to Inspects in Browser)
$new.insertBefore($top);
$new.find('input[type=text]').val('');
autoCalcSetup();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="container">
<form name="transactions">
<table class="table table-hover table-bordered table-striped" name="transactions">
<thead>
<tr>
<th></th>
<th>Item</th>
<th>Quantity</th>
<th>Price</th>
<th>Item Total</th>
</tr>
</thead>
<tbody>
<tr name="services">
<td><button class="btn btn-primary" name="remove">Remove</button></td>
<td>Stuff</td>
<td><input type="text" class="form-control" name="qty" value="3"></td>
<td><input type="text" class="form-control" name="price" value="12"></td>
<td><input type="text" class="form-control" name="item_total" jAutoCalc="{qty} * {price}"></td>
</tr>
<tr>
<td colspan="2"> </td>
<td>Subtotal</td>
<td> </td>
<td><input type="text" class="form-control" name="subtotal" jAutoCalc="SUM({item_total})"></td>
</tr>
<tr>
<td colspan="2"></td>
<td>Tax</td>
<td>
<select class="form-control" name="tax">
<option value=".06">CT Tax</option>
<option value=".00">Tax Free</option>
</select>
</td>
<td><input type="text" class="form-control" name="tax_total" jAutoCalc="{subtotal} * {tax}"></td>
</tr>
<tr>
<td colspan="2"></td>
<td>Total</td>
<td> </td>
<td><input type="text" class="form-control" name="grand_total" jAutoCalc="{subtotal} + {tax_total}"></td>
</tr>
<tr>
<td colspan="4"></td>
<td><button class="btn btn-primary" name="add">Add Row</button></td>
</tr>
</tbody>
</table>
</form>
</div>
I hope you can help me with this problem. If you have any question please don't hesitate to comment down below, and I will try my best to answer it just to solve my problem here. I need to do this for our Capstone Project. Thank so much! God bless you! :D

Table column width must be same for two tables html

There are two tables in the below example. Width is not set for the columns. I dont want the fixed width for the columns in two tables. I want to make columns width same depending upon the dynamic text generated. I am using angularjs and html for this. Here is the plunkr - https://plnkr.co/edit/AhS2AmL5O6QxZaHNAzPp?p=preview
html-
<html>
<head>
<script src="angular.min.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" href="style.css"/>
<link rel="stylesheet" href="font-awesome.min.css"/>
<link rel="stylesheet" href="bootstrap.min.css" />
</head>
<body data-ng-app="testApp" data-ng-controller="treeTable">
<hr>
<button type="button" class="btn btn-success" data-dismiss="modal" data-ng-click="save()">SaveFilter</button>
<div class="row">
<div class="col-md-9">
<div class="tableheight">
<table class="table-nested childtable">
<thead>
<tr>
<!-- <th >
<input data-ng-checked="(list | selected).length == list.length" data-ng-click="toggleAllCheckboxes($event)" type="checkbox" />
</th> -->
<th >
<input data-ng-checked="(list | selected).length == list.length" data-ng-click="toggleAllCheckboxes($event)" type="checkbox" /> Name
</th>
<th class="cell-members">
Version
</th>
<th class="cell-members">
Size
</th>
<th class="cell-members">
Modified By
</th>
<th class="cell-members">
Labels
</th>
<th class="cell-members">
Description
</th>
</tr>
</thead>
<tbody class="newRepo" style="font-size:12px" data-ng-class="{opened: item.opened}" data-ng-include="'table_tree.html'" data-ng-repeat="item in list"></tbody>
</table>
</div>
<script id="table_tree.html" type="text/ng-template">
<tr ng-class="{parent: item.children}" ng-init="parentScope = $parent.$parent; initCheckbox(item, parentScope.item)">
<td class="cell-name top-border" ng-if="level && level > 1">
<span style="padding-left: 30px" > <input ng-change="toggleCheckbox(item, parentScope)" ng-model="item.selected" type="checkbox" />
{{item.name}} </span>
</td>
<td class="cell-name top-border" ng-if=" (!level && level <= 1 ) |&#124 (level && level <= 1)">
<span style="padding-left:11px" ng-click="item.opened = !item.opened"></span> <input ng-change="toggleCheckbox(item, parentScope)" ng-model="item.selected" type="checkbox" />
{{item.name}}
</td>
<td class="cell-name top-border" ng-if="!level">
<span class="indent" ng-click="item.opened = !item.opened"></span> <input ng-change="toggleCheckbox(item, parentScope)" ng-model="item.selected" type="checkbox" />
{{item.name}}
</td>
<td class="cell-members">
{{item.Version}}
</td>
<td class="cell-members">
{{item.Size}}
</td>
<td class="cell-members">
{{item.ModifiedBy}}
</td>
<td class="cell-members">
{{item.Labels}}
</td>
<td class="cell-members">
{{item.Description}}
</td>
</tr>
<tr class="children" ng-if="item.children && item.children.length > 0">
<td colspan="6">
<table class="childtable">
<tbody style="font-size:12px" ng-class="{opened: item.opened}" ng-include="'table_tree.html'" ng-init="level = level + 1" ng-repeat="item in item.children"></tbody>
</table>
</td>
</tr>
</script>
</div>
</div>
</body>
</html>
I think this is what you want, change width into max-width:
.table-nested .cell-name {
max-width: 15rem;
/*width: 60%;*/
}
don't forget to comment out the width.
See plnkr: https://plnkr.co/edit/gYWusE9tqMX6D76bhcmW?p=preview
You can also use 60%. so: max-width: 60%
If you want all columns are in the same width, and since you're sure that you'll have exactly five columns in each table, I would suggest:
<table style="table-layout:fixed">
<col style="width:20%" span="5" />
<tr><!--stuffs...--></tr>
</table>

How to make row clickable in HTML table and exclude some columns and using AngularJs?

I have a table right here
<div class="table-responsive">
<table st-table="prijaveKvara" st-safe-src="displayedAllPrijaveKvara" class="table table-hover">
<thead>
<tr>
<th st-sort="">Slika</th>
<th st-sort="datum_kvara">Datum<br />kvara</th>
<th st-sort="marka">Automobil</th>
<th st-sort="prezime">Vozač</th>
<th st-sort="mjesto_nastanka_stete">Mjesto nastanka<br />štete</th>
<th st-sort="relacija">Putni nalog</th>
<th st-sort="tip_kvara">Tip kvara</th>
<th st-sort="opis_kvara">Opis kvara</th>
<th st-sort="vozilo_upotrebljivo">Vozilo<br />upotrebljivo</th>
<th>Storniraj/<br />povratak</th>
</tr>
<tr>
<th colspan="13">
<input st-search placeholder="global search" class="input-sm form-control" type="search" />
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="kvar in prijaveKvara" data-toggle="modal" data-target=".urediPrijavaKvara" ng-click="setKvarToEditSection(kvar)">
<td class="openImageGallery" ng-click="addDataToGalleryModal(kvar)">
<div data-toggle="modal" data-target=".imageGalleryKvarVozila">
<span ng-if="kvar.thumbnail_slika_kvara == null">
<i class="glyphicon glyphicon-remove" style="color:red;"></i>
</span>
<span ng-if="kvar.thumbnail_slika_kvara != null">
<i class="glyphicon glyphicon-ok" style="color:green;"></i>
</span>
</div>
</td>
<td>{{kvar.datum_kvara_form}}</td>
<td><a class="tooltips">{{kvar.marka}}<br />{{kvar.model}}<span>{{kvar.registarske_oznake}}</span></a></td>
<td>{{kvar.ime}} {{kvar.prezime}}</td>
<td>{{kvar.mjesto_nastanka_stete}}</td>
<td><a class="tooltips">{{kvar.relacija}}<span>Napomena: {{kvar.napomena}}<br />Detalji: {{kvar.detalji}}<br />Datum početka: {{kvar.datum_pocetka_form}} <br />Datum završetka: {{kvar.datum_zavrsetka_form}} <br />Kilometraža start: {{kvar.kilometraza_start}} <br />Kilometraža kraj: {{kvar.kilometraza_kraj}}</span></a></td>
<td><span ng-if="kvar.tip_kvara == 1">Sudar vozila</span><span ng-if="kvar.tip_kvara == 2">Kvar na motoru</span><span ng-if="kvar.tip_kvara == 3">Ostali kvarovi</span></td>
<td>{{kvar.opis_kvara}}</td>
<td style="margin:auto;">
<i ng-hide="kvar.vozilo_upotrebljivo" class="glyphicon glyphicon-remove" style="color:red;"></i><i ng-show="kvar.vozilo_upotrebljivo" class="glyphicon glyphicon-ok" style="color:green"></i>
</td>
<td style="margin:auto;"><span ng-hide="currentVozac[0].iDvozac != kvar.iDvozac"><i ng-hide="kvar.storno" class="glyphicon glyphicon-remove-circle InsuranceAndLeasingRecordsIconsInTable" ng-click="cancelPrijavaKvaraRecord(kvar.iDkvar)"></i><i ng-show="kvar.storno" class="glyphicon glyphicon-share-alt InsuranceAndLeasingRecordsIconsInTable" ng-click="returnPrijavaKvaraRecord(kvar.iDkvar)"></i></span></td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center" colspan="13">
<div style="float:left;margin-top:20px;">
<select class="form-control" ng-model="itemsByPage">
<option value="3">3</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</div>
<div st-pagination="" st-items-by-page="itemsByPage" st-displayed-pages="8"></div>
</td>
</tr>
</tfoot>
</table>
</div>
I have a function call that fills some data in modal diagram and also open that modal (it is a bootstrap). This is a peace of code
<tr ng-repeat="kvar in prijaveKvara" data-toggle="modal" data-target=".urediPrijavaKvara" ng-click="setKvarToEditSection(kvar)">
I would like to exclude this call for first and last column, but arrest of columns ( in row ) remains to call modal and the function.

knockout multiple with bindings

I have a page with several view models, and i need to dynamically build out a checkbox grid based on 2 of them.
This code populates the grid based on 1 view model:
<div id="fundingDetailLevels" class="scroll-adjust" data-bind="with: modelOne">
<table class="table table-hover">
<thead>
<tr data-bind="foreach: modelOneArray">
<!-- ko if: $index() == 0 -->
<th></th>
<!-- /ko -->
<th data-bind="text: name" ></th>
</tr>
</thead>
<tbody data-bind="foreach: modelOneArray2">
<tr data-bind="foreach: $parent.modelOneArray" >
<!-- ko if: $index() == 0 -->
<td data-bind="text: $parent.name"></td>
<!-- /ko -->
<td><input type="checkbox"></input></td>
</tr>
</tbody>
</table>
</div>
Which gives me a grid of:
header1 header2
row1 checkbox checkbox
row2 checkbox checkbox
but what I need is something closer to this:
<div id="fundingDetailLevels" class="scroll-adjust" data-bind="with: modelOne, modelTwo">
<table class="table table-hover">
<thead>
<tr data-bind="foreach: modelOneArray">
<!-- ko if: $index() == 0 -->
<th></th>
<!-- /ko -->
<th data-bind="text: name" ></th>
</tr>
</thead>
<tbody data-bind="foreach: modelTwoArray">
<tr data-bind="foreach: $parent.modelOneArray" >
<!-- ko if: $index() == 0 -->
<td data-bind="text: $parent.name"></td>
<!-- /ko -->
<td><input type="checkbox"></input></td>
</tr>
</tbody>
</table>
</div>
but that fails to find modelTwo
If you just make one view model then you can acheive what you are after. Try this:
var baseModel = function () {
var self = this;
self.modelOneArray = ko.observableArray([{ "name": "Jack" }, { "name": "Jimmy" }]);
self.modelTwoArray = ko.observableArray([{ "name": "Jack2" }, { "name": "Jimmy2" }]);
};
var myModel = myModel || {};
myModel = new baseModel();
ko.applyBindings(myModel);
and the html:
<div id="fundingDetailLevels" class="scroll-adjust">
<table class="table table-hover">
<thead>
<tr data-bind="foreach: modelOneArray">
<!-- ko if: $index()==0 -->
<th></th>
<!-- /ko -->
<th data-bind="text: name"></th>
</tr>
</thead>
<tbody data-bind="foreach: modelTwoArray">
<tr data-bind="foreach: myModel.modelOneArray">
<!-- ko if: $index()==0 -->
<td data-bind="text: myModel.modelOneArray().name"></td>
<!-- /ko -->
<td>
<input type="checkbox"></input>
</td>
</tr>
</tbody>
</table>
</div>