Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/react/excel-sorting/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Excel-like Sorting with sortEmpty</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
25 changes: 25 additions & 0 deletions examples/react/excel-sorting/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "tanstack-table-example-excel-sorting",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"start": "vite"
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/react-table": "^8.21.3",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@rollup/plugin-replace": "^5.0.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "5.4.5",
"vite": "^5.3.2"
}
}
184 changes: 184 additions & 0 deletions examples/react/excel-sorting/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
}

.app {
max-width: 1200px;
margin: 0 auto;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
overflow: hidden;
}

.header {
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}

.header h1 {
margin: 0 0 10px 0;
font-size: 24px;
}

.header p {
margin: 0 0 15px 0;
opacity: 0.9;
}

.header code {
background: rgba(255, 255, 255, 0.2);
padding: 2px 6px;
border-radius: 4px;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.features {
margin-top: 15px;
}

.features h3 {
margin: 0 0 10px 0;
font-size: 16px;
}

.features ul {
margin: 0;
padding-left: 20px;
}

.features li {
margin-bottom: 5px;
}

.table-container {
padding: 20px;
overflow-x: auto;
}

table {
width: 100%;
border-collapse: collapse;
border: 1px solid #e0e0e0;
border-radius: 6px;
overflow: hidden;
}

th {
background: #f8f9fa;
border-bottom: 2px solid #e0e0e0;
border-right: 1px solid #e0e0e0;
padding: 12px 8px;
text-align: left;
font-weight: 600;
font-size: 14px;
color: #495057;
}

th:last-child {
border-right: none;
}

th.sortable {
cursor: pointer;
user-select: none;
transition: background-color 0.2s;
}

th.sortable:hover {
background: #e9ecef;
}

.header-content {
display: flex;
align-items: center;
justify-content: space-between;
}

.sort-indicator {
margin-left: 4px;
font-size: 12px;
}

td {
padding: 10px 8px;
border-bottom: 1px solid #f0f0f0;
border-right: 1px solid #f0f0f0;
font-size: 14px;
}

td:last-child {
border-right: none;
}

tr:hover {
background-color: #f8f9fa;
}

tr:last-child td {
border-bottom: none;
}

.info {
padding: 20px;
background: #f8f9fa;
border-top: 1px solid #e0e0e0;
}

.info h3 {
margin: 0 0 10px 0;
font-size: 16px;
color: #495057;
}

.info pre {
background: #fff;
border: 1px solid #e0e0e0;
border-radius: 4px;
padding: 10px;
font-size: 12px;
overflow-x: auto;
margin: 0 0 20px 0;
}

.comparison {
margin-top: 20px;
}

.comparison-table {
font-size: 13px;
margin-top: 10px;
}

.comparison-table th {
background: #6c757d;
color: white;
font-size: 12px;
padding: 8px;
}

.comparison-table td {
padding: 8px;
text-align: center;
}

.comparison-table td:first-child {
text-align: left;
font-weight: 500;
}

code {
background: #f1f3f4;
padding: 2px 4px;
border-radius: 3px;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 13px;
}
Loading