From 04902babc5bfc89a58b61df284fdd11c4fc767a8 Mon Sep 17 00:00:00 2001 From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:52:06 -0400 Subject: [PATCH] FIxing syntax --- website/src/components/sortableTable/index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/website/src/components/sortableTable/index.js b/website/src/components/sortableTable/index.js index e1ebf7ff21a..d7e94143ece 100644 --- a/website/src/components/sortableTable/index.js +++ b/website/src/components/sortableTable/index.js @@ -4,17 +4,16 @@ const parseMarkdownTable = (markdown) => { const rows = markdown.trim().split('\n'); const headers = rows[0].split('|').map((header) => header.trim()).filter(Boolean); - // Parse the alignment row const alignmentsRow = rows[1].split('|').map((align) => align.trim()).filter(Boolean); const columnAlignments = alignmentsRow.map((alignment) => { if (alignment.startsWith(':') && alignment.endsWith(':')) { - return 'center'; // :-----: + return 'center'; } else if (alignment.startsWith(':')) { - return 'left'; // :----- + return 'left'; } else if (alignment.endsWith(':')) { - return 'right'; // -----: + return 'right'; } else { - return 'left'; // Default alignment + return 'left'; } }); @@ -56,7 +55,7 @@ const SortableTable = ({ children }) => { style={{ cursor: 'pointer', position: 'relative', - textAlign: columnAlignments[index], // Use detected alignment + textAlign: columnAlignments[index], padding: '10px' }} > @@ -89,7 +88,7 @@ const SortableTable = ({ children }) => {