I run a project that has a database in Google Sheets. I need to display that information in Interactive tables.
I used Sheetrock.js and Handlebar.js to do this (I wrote the code and it works as I want it to). I have a WordPress website and I want to make a plugin where I type a shortcode and the table I coded appears on the page.
I have a separate HTML file with embedded styling (under <style></style>
tags, no external css file). The file has an HTML boiler plate, and in the <head></head>
there are links to sheetrock.js, handlebar.js, and bootstrap.
As far as I understand, php can't display those HTML tags? I tried doing the following...
<?php
function showIco() {
?>
<!DOCTYPE html>
<head>
<!-- all the CDN links -->
</head>
<style>
<!-- all the styling is here, and I know, it's not DRY -->
</style>
<body>
<!-- The content I want to display (it has <script> tags, and variables) -->
</body>
</html>
<?php
return showIco();
}
add_shortcode ('add_ico','showIco');
?>
Perhaps I am doing something wrong as the shortcode doesn't display the content at all. What do I need to do to make this work?