To get the code blocks colored as in Cheat Sheet For Markdown I added the "**%%**HTML" code block below.
This tip was from the folowing Stack Exchange article
In [5]:
%%HTML
<style>
pre.bash {background-color : rgb(253, 246, 227) !important;}
span.mystyle {color: purple }
</style>
%%HTML
<style>
pre.bash {background-color : rgb(253, 246, 227) !important;}
code {background-color : rgb(253, 246, 227) !important;}
code.bash {background-color : lightgrey !important;}
span.mystyle {color: purple }
</style>
print "this is python code"
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
g++ -v
g++ hello.cc -o hello
g++ -v
g++ hello.cc -o hello
g++ -v
g++ hello.cc -o hello
In [2]:
from json2html import *
from IPython.display import display, HTML
mydict = { 'a':1, 'b':2, 'c':3}
htmlcss = """
<style type="text/css">
th { background-color: yellow;}
</style>
"""
myhtml = HTML(json2html.convert(json = mydict))
display(myhtml)
In [3]:
#after executing this cell, both tables change: the left column will have a yellow bg
myhtml.data = myhtml.data + htmlcss
display(myhtml)
In [ ]: