簡體   English   中英

如何更改 Antd 表中的 fontSize

[英]How to change the fontSize in an Antd table

我嘗試更改fontSize ,但沒有生效:

<Table
  style={{overflow: 'hidden', width: '100%', fontSize: '10px'}}
  dataSource={data.dataSource}
  columns={columns}
  size='small'
  bordered
  pagination={false}
/>

我的桌子也不適合這個街區。 僅顯示 3 列,rest 消失。 如何解決?

  • 你的樣式表.scss:

    .ant-table table { 字體大小:10px; }

這是您可以使用sass更少原始答案

    .booking_information_table {
        :global {
            .ant-table-thead > tr > th,
            .ant-table-tbody > tr > td {
                fontSize: '10px';
            }
    }

其次,您可以使用 Table 的滾動屬性並刪除溢出:隱藏

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM