Home >Web Front-end >HTML Tutorial >The td column in Table under ie7 and ie8 has a fixed width and is not displayed according to the style setting. Curve solution_html/css_WEB-ITnose

The td column in Table under ie7 and ie8 has a fixed width and is not displayed according to the style setting. Curve solution_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:33:541397browse

 1 <!doctype html> 2 <html> 3 <head> 4 <meta charset='utf-8'> 5 <style> 6 .title {background-color:#ccc;width: 150px} 7 </style> 8 </head> 9 <body>10 <table style='width:600px'>11 <tr>12 <td class='title'>哈哈</td>13 <td>aa</td>14 <td class='title'>大都市</td>15 <td>bb</td>16 </tr>17 <tr>18 <td class='title'>adad</td>19 <td colspan='3'>alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉alkjd阿拉快的拉拉</td>20 </tr>21 </table>22 </body>23 </html>

View Code

In this case, the three columns in the first row will be significantly expanded under ie7 and ie8. It fails to display

according to the style width (width: 150px). Solution:

1. Hard-code the width of each column

2. Change width:150px to width: 20% as a percentage

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn