In my laravel 5.7 application I use "yajra/laravel-datatables-oracle": "~8.0" library and I try to set columns width for grid with a lot of columns setting styles as :
#get-client-dt-listing-table th:first-child {
width: 2% !important;
background: maroon !important;
color: brown !important;
}
#get-client-dt-listing-table th:nth-child(2) {
width: 30% !important;
background: yellow !important;
color: blue !important;
}
#get-client-dt-listing-table thead th:nth-child(3) {
width: 20%;
background: red !important;
color: green !important;
}
#get-client-dt-listing-table thead th:nth-child(4) {
width: 10%;
background: maroon !important;
color: brown !important;
}
#get-client-dt-listing-table thead th:nth-child(5) {
width: 10%;
background: yellow !important;
color: blue !important;
}
#get-client-dt-listing-table thead th:nth-child(6) {
width: 10%;
background: maroon !important;
color: brown !important;
}
#get-client-dt-listing-table thead th:nth-child(7) {
width: 10%;
background: yellow !important;
color: blue !important;
}
#get-client-dt-listing-table thead th:nth-child(8) {
width: 10%;
background: maroon !important;
color: brown !important;
}
#get-client-dt-listing-table thead th:last-child(9) {
width: 4%;
background: yellow !important;
color: blue !important;
}
#get-client-dt-listing-table thead th:last-child{
width: 4%;
background: red !important;
color: green !important;
}
and having blade file :
@extends($current_admin_template.'.layouts.backend')
@section('content')
@inject('viewFuncs', 'App\library\viewFuncs')
<!-- Page Content : Clients index -->
<div id="page-wrapper" class="card">
@include($current_admin_template.'.layouts.page_header')
<section class="card-body content_block_admin_clients_wrapper ">
<h1 class="card-title">Manage Clients</h1>
<div class="form-row offset-1">
<div class="col-xs-12 col-sm-4 mb-3">
{!! $viewFuncs->text('filter_name', '', "form-control editable_field string_input ", [ "autocomplete"=>"off", 'placeholder'=> 'Enter search string' ] ) !!}
</div>
<div class="col-xs-12 col-sm-4 mb-3 mt-1 pl-2">
<input type="submit" class="btn btn-primary" value="Search" onclick="javascript:backendClient.runSearch(oTable); return false;" id="btn_run_search">
</div>
<div class="col-xs-12 col-sm-4 mb-3 mt-1 pl-2 pr-2">
<button type="button" onclick="javascript:document.location='/admin/clients/create'" class="btn btn-primary float-right">
<span class="btn-label"><i class="fa fa-plus"></i></span> Add new client
</button>
</div>
<div class="table-responsive dataTables_header">
<table class="table table-bordered table-striped text-primary" id="get-client-dt-listing-table">
<thead>
<tr>
<th>Id</th>
<th>Full Name</th>
<th>Lead Type</th>
<th>Customer Type</th>
<th>Account Type</th>
<th>PO box</th>
<th>Office fax </th>
<th>111</th>
<th>234</th>
</tr>
</thead>
</table>
</div>
</div>
</section> <!-- class="card-body" -->
</div>
<!-- /.page-wrapper Page Content : Clients index -->
@endsection
@section('scripts')
<link rel="stylesheet" href="" type="text/css">
<script src=""></script>
<script src=""></script>
<script src="?dt="></script>
<script>
/*<![CDATA[*/
var oTable
var backendClient = new backendClient('list', // must be called before jQuery(document).ready(function ($) {
<?php echo $appParamsForJSArray ?>
);
jQuery(document).ready(function ($) {
backendClient.onBackendPageInit('list')
});
/*]]>*/
</script>
@endsection
As I see my css styles arew applied(by colors to in styles ) but not width. You can to look at it live : http://demo2.nilov-sergey-demo-apps.tk/admin/clients It is under credentials admin@demo.com 111111
Why width are not applied and how to fix it?
Thanks!
from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2SPnCen
via IFTTT
Aucun commentaire:
Enregistrer un commentaire