Skip to content

Commit

Permalink
feat: change gantt header to table element
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyjone committed Apr 14, 2023
1 parent 36d7162 commit f95d8d7
Showing 1 changed file with 51 additions and 11 deletions.
62 changes: 51 additions & 11 deletions src/components/common/GanttHeader.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,67 @@
<template>
<div class="xg-gantt-header">
<div v-for="i in 100" :key="i" class="xg-gantt-header-cell">
{{ i }}
</div>
</div>
<table class="xg-gantt-header" cellpadding="0" cellspacing="0" border="0">
<colgroup>
<template v-for="i in 100" :key="i">
<col width="30px" />
</template>
</colgroup>
<thead>
<tr>
<th
v-for="i in 10"
:key="i"
class="xg-gantt-header-cell"
:style="{ ...$styleBox.getBorderColor() }"
colspan="10"
rowspan="1"
>
{{ i }}
</th>
</tr>
<tr>
<th
v-for="i in 100"
:key="i"
class="xg-gantt-header-cell"
:style="{ ...$styleBox.getBorderColor() }"
colspan="1"
rowspan="1"
>
{{ i }}
</th>
</tr>
</thead>
</table>
</template>

<script lang="ts" setup></script>
<script lang="ts" setup>
import useStyle from '@/composables/useStyle';
const { $styleBox } = useStyle();
</script>

<style lang="scss" scoped>
.xg-gantt-header {
width: 100%;
height: 80px;
position: sticky;
background-color: blueviolet;
table-layout: fixed;
border-collapse: separate;
top: 0;
position: sticky;
z-index: 10;
white-space: nowrap;
overflow: hidden;
.xg-gantt-header-cell {
width: 30px;
height: 100%;
overflow: hidden;
display: inline-block;
background-color: blueviolet;
text-overflow: ellipsis;
vertical-align: middle;
text-align: center;
position: relative;
box-sizing: border-box;
border-bottom: 1px solid;
border-right: 1px solid;
}
}
</style>

0 comments on commit f95d8d7

Please sign in to comment.