熊猫数据框到html调整宽度和长度

时间:2020-07-15 20:28:18

标签: python html css web

你好,我正在为一个学校项目建立一个网站,我想把桌子缩小一些。该表是从pd数据帧生成为HTML的。

代码:

  ba = data_income_statement.to_html(classes='table table-hover') #makes dataframe to HTML.


</table id="tableId" class="zebra" style="max-width:40px;">


<style>
   *{box-sizing: border-box;}
    table{border-collapse:collapse;}
    td,th{padding:100px 150px;text-align:left;}
    table,th,td{border:1px solid #000;
    margin-left: 300px;
    margin-right: ;
    margin-top: -85px; 
    max-width: 185px;

   </style>


 
    {{ba|safe}} #this is the dataframe
  
     </table>

This is what the table looks like on the website

0 个答案:

没有答案