Skip to content

Commit

Permalink
HighTable demo
Browse files Browse the repository at this point in the history
  • Loading branch information
platypii committed May 28, 2024
1 parent 8a4152d commit 892ec4a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
37 changes: 37 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HighTable Viewer Demo</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Mulish:wght@300;600&display=swap"/>
<link rel="stylesheet" href="src/hightable.css">
<style>
body {
font-family: 'Mulish', 'Helvetica Neue', Helvetica, Arial, sans-serif;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="root"></div>
<script type="module">
import React from 'https://cdn.skypack.dev/react@17'
import ReactDOM from 'https://cdn.skypack.dev/react-dom@17'
import HighTable from './dist/hightable.min.js'

const header = ['ID', 'Name', 'Age']
const data = [
[1, 'Alice', 25],
[2, 'Bob', 28],
[3, 'Carol', 32],
]

ReactDOM.render(
React.createElement(HighTable, { header, data }),
document.getElementById('root')
)
</script>
</body>
</html>
9 changes: 8 additions & 1 deletion src/hightable.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
.outer {
.table-container {
display: flex;
flex: 1;
min-height: 0;
position: relative;
}

.table-container * {
box-sizing: border-box;
margin: 0;
padding: 0;
}

.tableScroll {
flex: 1;
overflow: auto;
Expand Down
2 changes: 1 addition & 1 deletion src/hightable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function HighTable({ header, data }: TableProps) {
return undefined
}

return <div className='outer'>
return <div className='table-container'>
<div style={{ overflow: 'auto' }}>
<table className='table'>
<thead>
Expand Down

0 comments on commit 892ec4a

Please sign in to comment.