Skip to content

Commit c6d249d

Browse files
committed
alternate line background
1 parent dd87bee commit c6d249d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

dist/crud-table-config-html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let table_config = {
1010
{name: 'private', show: true, edit: false, size: '200px'},
1111
{name: 'html', show: true, edit: true, size: '500px', type: 'html'}
1212
],
13-
row_settings: {height: '2em'}
13+
row_settings: {height: '1.3em'}
1414
}
1515

1616
let genericCrudTable = document.querySelector('crud-table');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-generic-crud-table",
3-
"version": "1.5.65",
3+
"version": "1.5.66",
44
"description": "<crud-table> renders object-arrays with options-panel and inline edit per row. Dispatches events for ongoing data handling. As self-containing webcomponent or for Svelte in 60KB",
55
"main": "dist/build/crud-table.js",
66
"module": "dist/build/crud-table.mjs",

src/SvelteGenericCrudTable.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
{#if Array.isArray(table_data)}
173173
<div class="table">
174174
<div class="thead"
175-
style="border-left: 0.1em solid #efefef;max-height:{(table_config.row_settings !== undefined) && (table_config.row_settings.height !== undefined) ? table_config.row_settings.height : table_config_default.row_settings.height};">
175+
style="max-height:{(table_config.row_settings !== undefined) && (table_config.row_settings.height !== undefined) ? table_config.row_settings.height : table_config_default.row_settings.height};">
176176
<!-- /* istanbul ignore next line */ -->
177177
{#each table_config.columns_setting as elem, index}
178178
<!-- /* istanbul ignore next line */ -->
@@ -200,8 +200,8 @@
200200

201201
<!-- /* istanbul ignore next line */ -->
202202
{#each table_data as tableRow, i (tableRow)}
203-
<div class="row"
204-
style="background-color:{i % 2 === 0 ? '#efefef' : '#ffffff'};min-height:{(table_config.row_settings !== undefined) && (table_config.row_settings.height !== undefined) ? table_config.row_settings.height : table_config_default.row_settings.height};">
203+
<div class="row {i % 2 === 0 ? 'dark' : ''}"
204+
style="min-height:{(table_config.row_settings !== undefined) && (table_config.row_settings.height !== undefined) ? table_config.row_settings.height : table_config_default.row_settings.height};">
205205
{#each table_config.columns_setting as column_order, j}
206206
{#each Object.entries(tableRow) as elem, k}
207207
<!-- /* istanbul ignore next */ -->
@@ -342,10 +342,14 @@
342342
resize: vertical;
343343
}
344344
345-
.row:hover {
345+
.dark {
346346
background-color: #efefef;
347347
}
348348
349+
.row:hover {
350+
background-color: rgba(0,0,0,0.1);
351+
}
352+
349353
.td {
350354
color: #5f5f5f;
351355
border: none;

0 commit comments

Comments
 (0)