I'm generating this html code from a dataframe, like the one in the example, but the col_space
parameter, from the to_html
function, isn't being applied in the final code.
df = pd.DataFrame({'calorias':[200, 350, 550], 'gordura (%)':[0, 6, 15]}, index=['banana', 'prato feito', 'big mac'])
comida | calorias | gordura (%) |
---|---|---|
banana | 200 | 0 |
prato feito | 350 | 6 |
big mac | 550 | 15 |
df.to_html(classes='table table-striped', border=0, index=False, justify='left', col_space="100px")
<table border="0" class="dataframe table table-striped">\n <thead>\n <tr style="text-align: left;">\n <th style="min-width: 100px;">calorias</th>\n <th style="min-width: 100px;">gordura (%)</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>200</td>\n <td>0</td>\n </tr>\n <tr>\n <td>350</td>\n <td>6</td>\n </tr>\n <tr>\n <td>550</td>\n <td>15</td>\n </tr>\n </tbody>\n</table>'