In [15]:
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
           ])
    
In [7]:
%%html
<style type='text/css'>
span.listofstr {
  margin-left: 5px
}
</style>
In [16]:
ListOfStrings("hi", "hello", "hello there")
Out[16]:
hihellohello there
Back to top