table 原生表格设置宽度
1. table 样式: table-layout: fixed;
2. th, td:word-wrap:break-word
有些浏览器的滚动条样式贼丑,还不让美化,这个组件助你一臂之力(react-free-scrollbar)
浏览器计算字符串占用的字节大小,不用考虑是否含有中文
var str = '我爱你中国';
var blob = new Blob([str]);
console.log(blob.size);
自定义滚动条样式
.self-define-scroll {
max-height: 300px;
overflow-y: auto;
&::-webkit-scrollbar{
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-track {
border-radius: 3px;
background: rgba(255,255,255,0.5);
}
&::-webkit-scrollbar-thumb {
border-radius: 3px;
background-color: rgba(0, 0, 0, .5);
}
}