|
|
@@ -89,9 +89,10 @@ class TableModel extends React.Component {
|
|
|
let node = this.refs.body;
|
|
|
let title = node.getElementsByClassName('rc-table-title')[0] || { offsetHeight: 0 };
|
|
|
let thead = node.getElementsByClassName('rc-table-thead')[0];
|
|
|
- this.cHeight = node.offsetHeight - 4 - title.offsetHeight; // 这里的4是上下padding和border
|
|
|
+ this.cHeight = node.offsetHeight - title.offsetHeight;
|
|
|
let trHeight = (this.cHeight) / (this.rowCount + 1);
|
|
|
- let trFontSize = pageSize ? `${fontSize/.6 > trHeight ? trHeight * .6 : fontSize}px` : `${trHeight * .6}px`;
|
|
|
+ // let trFontSize = pageSize ? `${fontSize/.6 > trHeight ? trHeight * .6 : fontSize}px` : `${trHeight * .6}px`;
|
|
|
+ let trFontSize = `${fontSize}px`;
|
|
|
thead.style.fontSize = trFontSize;
|
|
|
thead.getElementsByTagName('th')[0].style.height = `${trHeight}px` ;
|
|
|
let count = this.state.data.length;
|
|
|
@@ -129,10 +130,10 @@ class TableModel extends React.Component {
|
|
|
let oldTds = oldTrs[i].getElementsByTagName('td');
|
|
|
for (let j = 0; j < oldTds.length; j++) {
|
|
|
// 设置旧td=新td宽度
|
|
|
- oldTds[j].style.maxWidth = `${newTds[j].offsetWidth - 2}px`;
|
|
|
- oldTds[j].style.minWidth = `${newTds[j].offsetWidth - 2}px`;
|
|
|
- oldTds[j].width = newTds[j].offsetWidth - 2;
|
|
|
- oldTds[j].height = newTds[j].offsetHeight - 2;
|
|
|
+ oldTds[j].style.maxWidth = `${newTds[j].offsetWidth}px`;
|
|
|
+ oldTds[j].style.minWidth = `${newTds[j].offsetWidth}px`;
|
|
|
+ oldTds[j].width = newTds[j].offsetWidth;
|
|
|
+ oldTds[j].height = newTds[j].offsetHeight - 2;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -241,7 +242,7 @@ class TableModel extends React.Component {
|
|
|
render() {
|
|
|
const { fontSize } = this.newProps;
|
|
|
return (
|
|
|
- <div ref='body' style={{ height: '100%', overflow: 'hidden', fontSize: fontSize }}>
|
|
|
+ <div ref='body' style={{ height: '100%', overflow: 'hidden', fontSize: fontSize, padding: '0px' }}>
|
|
|
<Table
|
|
|
prefixCls={this.newProps.prefixCls || 'rc-table'}
|
|
|
className={this.newProps.className}
|