Previously, I summarized how to use CSS to achieve the border + bordercolordark + bordercolorlight effects of a table. Then a netizen asked me why he wrote a similar CSS style, but the table border effect can only be seen normally under Opera, but nothing under IE. I downloaded Opera 9 and saw that it was indeed the case. The reason is not complicated: because in IE (Firefox seems to be the same as IE), if the content of a td is empty, even if you set the height and width, the border style of the cell will not be displayed; Opera applies the style to render regardless of whether there is content or not. I encountered this problem right after I graduated. The section chief of the department came to ask me, and I told him: Just add it to each empty td. Whenever I encounter this problem in the future, I will use this simple, rough and effective method to solve it. But today I made great efforts to study it a bit, and learned from Jiarry that the original CSS syntax allows us to change these default behaviors: using border-collapse:collapse; and empty-cells:show; can make the disappeared border appear. class="test1": add border-collapse:collapse; .test1{ border:1px solid #999999; border-collapse:collapse; width:60% } .test1 td{ border-bottom:1px solid #999999; height:28px; padding-left:6px; } class1 Here is the content Here is the content class="test2": add border-collapse:collapse; and empty-cells:show; .test2{ border:1px solid black; border-collapse:collapse; width:60% } .test2 td{ border-bottom:1px solid black; height:28px; padding-left:6px; empty-cells:show; } class2 Here is the content Here is the content class="test3": Without border-collapse:collapse; and empty-cells:show; .test3{ border:1px solid #999999; width:60% } .test3 td{ border-bottom:1px solid #999999; height:28px; padding-left:6px; } class3 Here is the content Here is the content |
<<: Examples of using MySQL covering indexes
>>: Analysis and solution of the reason why overflow-y: visible; does not work in CSS
The DATE_ADD() function adds a specified time int...
Table of contents For example: General writing: S...
This article shares with you the installation and...
1. Import csv file Use the following command: 1.m...
How to install MySQL 5.7 in Ubuntu 16.04? Install...
System version [root@ ~]# cat /etc/redhat-release...
1. mpstat command 1.1 Command Format mpstat [ -A ...
【1】Know the width and height of the centered elem...
Mysql left join is invalid and how to use it When...
MySQL itself was developed based on the file syst...
This article mainly introduces the effect of div ...
Download the rpm installation package MySQL offic...
Preface Docker can configure environment variable...
Disabling and enabling MySQL foreign key constrai...
Copy code The code is as follows: Difference betw...