Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
table_01 [2023/09/21 08:09] demiurgetable_01 [2023/09/22 22:03] (current) demiurge
Line 1609: Line 1609:
     </table>     </table>
     </div>     </div>
 +        <script>
 +        function applyHexColorToTableCells() {
 +            // Get all table cells
 +            let tableCells = document.querySelectorAll('td');
 +
 +            // Regular expression to match hex color codes
 +            let hexPattern = /#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/g;
 +
 +            tableCells.forEach(cell => {
 +                // Find all hex codes in the text of the cell
 +                let matches = cell.textContent.match(hexPattern);
 +
 +                if (matches && matches.length > 0) {
 +                    // If there's a hex code, change the font color of the cell
 +                    // to the hex code found in the cell
 +                    cell.style.color = matches[0];
 +                }
 +            });
 +        }
 +
 +        // Call the function on page load
 +        applyHexColorToTableCells();
 +    </script>
 </HTML> </HTML>