Format tables properly
This commit is contained in:
@@ -85,13 +85,13 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Line data="{data}" />
|
<Line data="{data}" class="max-h-[50vh] h-[50vh]" />
|
||||||
<div class="relative flex flex-col h-screen" data-vaul-drawer-wrapper id="page">
|
<div class="relative flex flex-col h-[43vh]" data-vaul-drawer-wrapper id="page">
|
||||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
|
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
|
||||||
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
||||||
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800" scope="col">
|
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800 w-2/12" scope="col">
|
||||||
Period
|
Period
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3" scope="col">
|
<th class="px-6 py-3" scope="col">
|
||||||
|
@@ -93,7 +93,5 @@
|
|||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
on:keydown={update}>
|
on:keydown={update}>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4">
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -61,22 +61,22 @@
|
|||||||
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
||||||
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800" scope="col">
|
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800 w-2/12" scope="col">
|
||||||
Date
|
Date
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3" scope="col">
|
<th class="px-6 py-3 w-3/12" scope="col">
|
||||||
Food
|
Food
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800" scope="col">
|
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800 w-4/12" scope="col">
|
||||||
Description
|
Description
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3" scope="col">
|
<th class="px-6 py-3 w-1/12" scope="col">
|
||||||
Amount
|
Amount
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800" scope="col">
|
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800 w-1/12" scope="col">
|
||||||
Cal Per 100
|
Cal Per 100
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3" scope="col">
|
<th class="px-6 py-3 w-1/12" scope="col">
|
||||||
Energy
|
Energy
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@@ -7,9 +7,10 @@
|
|||||||
let item: Weight = {
|
let item: Weight = {
|
||||||
weight: 0
|
weight: 0
|
||||||
}
|
}
|
||||||
let weight: string = item.weight.toString()
|
let weight: string | null = null
|
||||||
|
|
||||||
async function update(event: KeyboardEvent & { currentTarget: (EventTarget & HTMLTableCellElement) }) {
|
async function update(event: KeyboardEvent & { currentTarget: (EventTarget & HTMLTableCellElement) }) {
|
||||||
|
if (!weight) return
|
||||||
weight = weight.trim()
|
weight = weight.trim()
|
||||||
|
|
||||||
if (event.key == 'Enter') {
|
if (event.key == 'Enter') {
|
||||||
@@ -44,7 +45,5 @@
|
|||||||
autofocus
|
autofocus
|
||||||
on:keydown={update}>
|
on:keydown={update}>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4">
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -28,10 +28,10 @@
|
|||||||
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
||||||
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800" scope="col">
|
<th class="px-6 py-3 bg-gray-50 dark:bg-gray-800 w-2/12" scope="col">
|
||||||
Date
|
Date
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3" scope="col">
|
<th class="px-6 py-3 w-10/12" scope="col">
|
||||||
Weight
|
Weight
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
Reference in New Issue
Block a user