如下图所示,我对td设置了196px,结果computed显示的却是233px.
百度说什么对table设置如下,也不起作用~~
border-collapse: collapse;
border-spacing: 0;
word-wrap: break-word;
word-break: break-all;
#common-box {
width: 550px;
border-radius: 4px;
margin: 0 auto;
box-sizing: border-box;
background: #ffffff;
}
#common-box .regist-login-button {
display: inline-block;
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
border-radius: 4px;
color: #ffffff;
background: pink;
font-size: 18px;
}
#common-box table tbody tr {
width: 100%;
}
#common-box table tbody tr td {
height: 50px;
color: #999999;
font-size: 14px;
position: relative;
padding: 0;
}
#common-box table tbody tr td input,
#common-box table tbody tr td select {
width: 100%;
height: 50px;
line-height: 50px;
padding-left: 20px;
border: 1px solid pink;
border-radius: 4px;
box-sizing: border-box;
}
#common-box table tbody tr td button {
width: 100%;
height: 100%;
appearance: none;
border: none;
}
#common-box table tbody tr td:first-of-type {
width: 95px;
color: #666666;
font-size: 14px;
}
#common-box table tbody tr td select {}
#common-box table tbody tr td.select-ele::after {
content: '';
display: block;
width: 36px;
height: 50px;
position: absolute;
top: 0;
right: 0;
background: pink url(../../../static/img/more.png) center center no-repeat;
border-radius: 0 4px 4px 0;
cursor: pointer;
pointer-events: none;
}
#common-box table tr .rl-td-h80 {
height: 80px;
}
#common-box table tr .rl-td-h60 {
height: 60px;
}
#common-box table tr .rl-td-h50 {
height: 50px;
}
#common-box table tr .rl-td-h40 {
height: 40px;
}
#common-box table tr .rl-td-h30 {
height: 30px;
}
#common-box table tr .rl-td-w335 {
width: 335px;
}
#common-box table tr .rl-td-w220 {
width: 220px;
}
#common-box table tr .rl-td-w205 {
width: 205px;
}
#common-box table tr .rl-td-w105 {
width: 105px;
}
#common-box table tr .rl-td-w20 {
width: 20px;
}
#common-box table tr .rl-td-w10 {
width: 10px;
}
#common-box table tr .notice {
display: none;
font-size: 12px;
color: #ff2a14;
}
#common-box #validate {
width: 100%;
height: 100%;
border: 1px solid pink;
border-radius: 4px;
font-size: 0;
}
#common-box #validate canvas {
width: 100%;
height: 100%;
border-radius: 4px;
}
#login_form {
margin-top: 50px;
padding: 0 60px;
}
#login_form table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
word-wrap: break-word;
word-break: break-all;
}
#common-box #login_form table tbody tr td:first-of-type {
width: 42px;
}
#common-box #login_form table tbody tr:last-of-type td:first-of-type {
width: 205px;
text-align: right;
}
#common-box {
width: 550px;
border-radius: 4px;
margin: 0 auto;
box-sizing: border-box;
background: #ffffff;
}
#common-box .regist-login-button {
display: inline-block;
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
border-radius: 4px;
color: #ffffff;
background: pink;
font-size: 18px;
}
#common-box table tbody tr {
width: 100%;
}
#common-box table tbody tr td {
height: 50px;
color: #999999;
font-size: 14px;
position: relative;
padding: 0;
}
#common-box table tbody tr td input,
#common-box table tbody tr td select {
width: 100%;
height: 50px;
line-height: 50px;
padding-left: 20px;
border: 1px solid pink;
border-radius: 4px;
box-sizing: border-box;
}
#common-box table tbody tr td button {
width: 100%;
height: 100%;
appearance: none;
border: none;
}
#common-box table tbody tr td:first-of-type {
/* width: 95px; */
color: #666666;
font-size: 14px;
}
#common-box table tbody tr td select {}
#common-box table tbody tr td.select-ele::after {
content: '';
display: block;
width: 36px;
height: 50px;
position: absolute;
top: 0;
right: 0;
background: pink url(../../../static/img/more.png) center center no-repeat;
border-radius: 0 4px 4px 0;
cursor: pointer;
pointer-events: none;
}
#common-box table tr .rl-td-h80 {
height: 80px;
}
#common-box table tr .rl-td-h60 {
height: 60px;
}
#common-box table tr .rl-td-h50 {
height: 50px;
}
#common-box table tr .rl-td-h40 {
height: 40px;
}
#common-box table tr .rl-td-h30 {
height: 30px;
}
#common-box table tr .rl-td-w365 {
width: 365px;
}
#common-box table tr .rl-td-w255 {
width: 255px;
}
#common-box table tr .rl-td-w220 {
width: 220px;
}
#common-box table tr .rl-td-w205 {
width: 205px;
}
#common-box table tr .rl-td-w105 {
width: 105px;
}
#common-box table tr .rl-td-w100 {
width: 100px;
}
#common-box table tr .rl-td-w95 {
width: 95px;
}
#common-box table tr .rl-td-w45 {
width: 45px;
}
#common-box table tr .rl-td-w20 {
width: 20px;
}
#common-box table tr .rl-td-w10 {
width: 10px;
}
#common-box table tr .notice {
display: none;
font-size: 12px;
color: #ff2a14;
}
#common-box #validate {
width: 100%;
height: 100%;
border: 1px solid pink;
border-radius: 4px;
font-size: 0;
}
#common-box #validate canvas {
width: 100%;
height: 100%;
border-radius: 4px;
}
#login_form {
padding: 0 60px;
}
#login_form table {
width: 100%;
}
#common-box #login_form table tbody tr td:first-of-type {
/* width: 45px; */
}
#common-box #login_form table tbody tr:last-of-type td:first-of-type {
text-align: right;
}