Browse Source

双表头样式优化

jqh 5 years ago
parent
commit
c7e4cbeb9e

+ 30 - 0
resources/assets/dcat/sass/components/_table.scss

@@ -130,3 +130,33 @@ table.dataTable.complex-headers thead th, table.dataTable.complex-headers thead
 .dataTable.table-bordered:not(.complex-headers) thead tr th:first-child {
   border-left: 1px solid darken($border-color, 3%);
 }
+
+/* ------------------- 多表头 --------------------- */
+table.table-bordered.dataTable.complex-headers {
+  border-spacing: 0;
+
+  tbody tr {
+    box-shadow: none;
+    border-radius: 0;
+
+    td {
+      border-bottom: 1px solid #f1f1f1;
+      border-right: 1px solid #f1f1f1;
+    }
+
+    td:first-child {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
+
+    td:last-child {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
+      border-right: 0;
+    }
+  }
+
+  tbody tr:last-child td {
+    border-bottom: 0;
+  }
+}

+ 7 - 1
resources/views/grid/data-list-view-table.blade.php

@@ -34,7 +34,13 @@
     {!! $grid->renderHeader() !!}
 
     <div class="table-responsive" style="{!! $grid->option('show_bordered') ? 'padding:3px 10px 0;margin-bottom:10px!important' : '' !!}">
-        <table class="table data-list-view dataTable dt-checkboxes-select {{ $grid->option('table_class') }} {{ $grid->option('show_bordered') ? 'table-bordered' : '' }} " id="{{ $tableId }}">
+        <table
+                class="table data-list-view dataTable dt-checkboxes-select
+                 {{ $grid->getComplexHeaders() ? 'complex-headers' : ''}}
+                {{ $grid->option('table_class') }}
+                {{ $grid->option('show_bordered') ? 'table-bordered' : '' }} "
+                id="{{ $tableId }}"
+        >
             <thead>
             @if ($headers = $grid->getComplexHeaders())
                 <tr>

+ 7 - 1
resources/views/grid/table.blade.php

@@ -34,7 +34,13 @@
     {!! $grid->renderHeader() !!}
 
     <div class="table-responsive complex-container" style="{!! $grid->option('show_bordered') ? 'padding:3px 10px 10px' : '' !!};border-bottom: 1px solid #f8f8f8!important;">
-        <table class="table dt-checkboxes-select  {{ $grid->option('table_class') }} {{ $grid->option('show_bordered') ? 'table-bordered complex-headers dataTable' : '' }} " id="{{ $tableId }}">
+        <table
+                class="table dt-checkboxes-select
+                {{ $grid->getComplexHeaders() ? 'complex-headers' : ''}}
+                {{ $grid->option('table_class') }}
+                {{ $grid->option('show_bordered') ? 'table-bordered complex-headers dataTable' : '' }} "
+                id="{{ $tableId }}"
+        >
             <thead>
             @if ($headers = $grid->getComplexHeaders())
                 <tr>

+ 0 - 0
tests/.ide-helper.php → tests/resources/.ide-helper.php