class ListOfStrings(object):
def __init__(self, *strings):
self.strings = strings
def _repr_html_(self):
return ''.join( [
"<span class='listofstr'>%s</span>" % s
for s in self.strings
])
%%html
<style type='text/css'>
span.listofstr {
margin-left: 5px
}
</style>
ListOfStrings("hi", "hello", "hello there")