inotgo.com


Tool version compatibility problem
use css Compare with not using
Correct

Example 1 : Do not use css   
Example 2 : use css   
Example 3 : different td There are different background colors   

Do not use css Add a background color to each cell
You need to give everyone td Element plus bgcolor attribute
Operation effect
<table border="1"> <tr > <td bgcolor="gray" >1</td> <td bgcolor="gray">2</td> </tr> <tr> <td bgcolor="gray">3</td> <td bgcolor="gray">4</td> </tr> <tr> <td bgcolor="gray">a</td> <td bgcolor="gray">b</td> </tr> </table>
<table border="1">
  <tr >
      <td bgcolor="gray" >1</td>
      <td bgcolor="gray">2</td>
  </tr>
 
  <tr>
      <td  bgcolor="gray">3</td>
      <td  bgcolor="gray">4</td>
  </tr>
 
  <tr>
      <td  bgcolor="gray">a</td>
      <td  bgcolor="gray">b</td>
  </tr>
 
</table>


Source code
1. Double click the selected word 2. Triple Click to select the entire row 3. CTRL+F Find 4. F8 Full screen editing , Click restore again
Rendering Rendering complete
effect
use css Add a background color to each cell
Just write a paragraph at the beginning css code , All cells have a background color

This is a layered design idea ,css Handle and color , Information such as size and location is stripped to <style> In , and html Just care about what kind of content to provide .
Operation effect
<style> td{ background-color:gray; } </style> <table border="1"> <tr > <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>


Source code
1. Double click the selected word 2. Triple Click to select the entire row 3. CTRL+F Find 4. F8 Full screen editing , Click restore again
Rendering Rendering complete
effect
Example 3 :

different td There are different background colors

edit top fracture
This involves the knowledge of selectors , Please look at Selector chapter


The official account of programming , Follow and get the latest tutorials and promotions in real time , thank you .


Q & A area    
2020-09-13 Webmaster's tutorial roar !
FARO_Z

about Front end part -CSS- course Your questions
w3cschool The tutorial just threw everything to you , It feels disorganized to learn . Webmaster, I still like this teaching method




1 One answer

Young0314
Answer time :2021-03-04
<table back-ground="green"> <tr> <td bgcolor="red" height=100 width=100></td> <td bgcolor="yellow" height=100 width=100></td> <td bgcolor="blue" height=100 width=100></td> </tr> <tr> <td bgcolor="pink" height=100 width-100></td> <td bgcolor="black" height=100 width=100></td> <td bgcolor="orange" height=100 width=100></td> </tr> <tr> <td bgcolor="hardbrown" height=100 width=100></td> <td bgcolor="grey" height=100 width=100></td> <td bgcolor="deepgrey" height=100 width=100></td> </table>



The answer has been submitted successfully , Auditing . Please My answer Check the answer record at , thank you
answer Or code please Fill in at least one , If you have a problem , Please ask again , Otherwise, the webmaster may not see




2020-04-25 about background and background-color The difference between
Xiaoyuan

about Front end part -CSS- course Your questions
There is little difference between the two ,background-color Is a more detailed regulation. Only the background color can be set , and background More than setting the background color , You can also add pictures as background , background-color:grey equal background:grey But background:url(' Picture path '), You can set other functions such as background pictures




2 One answer

Wang Caicai
Answer time :2021-11-04
<style> td {background-color:red; width=40px; height=40px;} </style> <table border="1"> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>44</td> <td>55</td> <td>33</td> </tr> <tr> <td>77</td> <td>66</td> <td>22</td> </tr> </table>

Young0314
Answer time :2021-03-04
<table back-ground="green"> <tr> <td bgcolor="red" height=100 width=100></td> <td bgcolor="yellow" height=100 width=100></td> <td bgcolor="blue" height=100 width=100></td> </tr> <tr> <td bgcolor="pink" height=100 width-100></td> <td bgcolor="black" height=100 width=100></td> <td bgcolor="orange" height=100 width=100></td> </tr> <tr> <td bgcolor="hardbrown" height=100 width=100></td> <td bgcolor="grey" height=100 width=100></td> <td bgcolor="deepgrey" height=100 width=100></td> </table>



The answer has been submitted successfully , Auditing . Please My answer Check the answer record at , thank you
answer Or code please Fill in at least one , If you have a problem , Please ask again , Otherwise, the webmaster may not see




2020-03-07 You can use css To align ?
2020-01-05 Front end of small business Time-CSS course
2018-12-29 This part is CSS2?


Too many questions , Page rendering is too slow , To speed up rendering , Only a few questions are displayed on this page at most . also 2 Previous questions , please Click to view

Please... Before asking questions land
The question has been submitted successfully , Auditing . Please My question Check the question record at , thank you
about Front end part -CSS- course Your questions

Try to provide Screenshot code and Abnormal information , Help to analyze and solve problems . You can also enter this station QQ Group communication : 496725845
Ask questions and try to provide complete code , Environment description , The more conducive to the recurrence of the problem , The faster your question can be answered .
Have questions about the code in the tutorial , Please provide which step , Which line is in doubt , This makes it easy to quickly locate the problem , Improve the speed at which questions are answered
In the thousands of questions that already exist , A considerable proportion , Because of the use of and webmaster Different versions of the development environment Resulting in , For example jdk, eclpise, idea, mysql,tomcat Wait, the version of the software is inconsistent .
Please use the same version as the webmaster , You can save yourself a lot of learning time . The webmaster sorted out the software versions used in teaching , It's all here , Convenient for everyone to download : /k/helloworld/helloworld-version/1718.html

Upload screenshot