The following situations were discovered during development: Copy code The code is as follows:<%@page contentType="text/html; charset=utf-8" pageEncoding="utf-8" language="java" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Make the table 100% visible</title> </head></p> <p><body style="background:#9C9;"> <table cellpadding="0" cellspacing="0" style="width:100%;" > <tr> <td height="8" width="17px;" ><img src="img/bg-header_l.gif" width="17" height="8" /></td> <td style="background:url(img/bg-header_c.gif) repeat-x;"></td> <td height="8" width="17px;" ><img src="img/bg-header_r.gif" width="17" height="8" /></td> </tr> </table> </body> </html> After the program runs, the effect displayed on the page is as shown below: (1) The background of the middle TD does not cover the entire TD; (2) The entire table width does not fill the entire screen. I can't figure it out and I'm very depressed! ! Try adding border="0" to the table in the background, the effect is still as shown in the figure above. After changing 0 to 1, I found that the table filled the entire screen and the td was also covered by the background, as shown below, but the border of the table is not what I want. Then I checked the three td in the table and found that there was no content in the second td, so I tried to fill in the second td. The code is as follows: Copy code The code is as follows:<table cellpadding="0" cellspacing="0" style="width:100%;" > <tr> <td height="8" width="17px;" ><img src="img/bg-header_l.gif" width="17" height="8" /></td> <td style="background:url(img/bg-header_c.gif) repeat-x;">Add content to the second td</td> <td height="8" width="17px;" ><img src="img/bg-header_r.gif" width="17" height="8" /></td> </tr> </table> The effect after running the code is basically consistent with the final result. The running effect is as follows: Copy code The code is as follows:<%@page contentType="text/html; charset=utf-8" pageEncoding="utf-8" language="java" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Make the table 100% visible</title> </head> <body style="background:#9C9;"> <table cellpadding="0" cellspacing="0" style="width:100%;" > <tr> <td height="8" width="17px;" ><img src="img/bg-header_l.gif" width="17" height="8" /></td> <td style="background:url(img/bg-header_c.gif) repeat-x; font-size:0px;"> </td> <td height="8" width="17px;" ><img src="img/bg-header_r.gif" width="17" height="8" /></td> </tr> </table> </body> </html> The final effect is shown in the figure below: |
<<: Several things to note when making a web page
>>: TypeScript problem with iterating over object properties
Install MySQL for the first time on your machine....
mysql-5.7.20-winx64.zipInstallation package witho...
Effect The pictures in the code can be changed by...
Table of contents Same Origin Policy Ajax request...
1. Introduction Recently, I helped a friend to ma...
This question is very strange, so I will go strai...
When href is needed to pass parameters, and the p...
CSS matches multiple classes The following HTML t...
This article example shares the specific code of ...
Recently, when using Apple.com/Ebay.com/Amazon.co...
Must read before operation: Note: If you want to ...
Reference Documentation Official Docker installat...
To execute a shell command in Docker, you need to...
Table of contents 1 What is SSH 2 Configure SSH p...
1. Preparation 1.1 Download and install VMware 15...