A lot of friends are very distressed table style how to set, today will give you a detailed explanation of CSS table style how to set, before said three methods, only the table set the border, the TD set the border, To table and TD tricks to set the table border now gives you how to set the table and TD background to implement the form border, I hope you read after the harvest.
First set the table CSS background to red
Then set the spacing between table cells to 1
Using the DW software assistance to set the table cell spacing of 1, specific DW software visualization procedures, a brief description, first (view mode) when the table is selected, the corresponding DW software editing window at the bottom of the "Properties" panel will appear the corresponding Table table property settings, we fill the "Interval" as "1". At this point we will see the Table tab with the cellspacing value "1" (cellspacing= "1").
Use the DW software to set the spacing between table cells or
Directly to the <table> tag within the cellspacing= "1" can Be, get:
<table width= "border=" 0 "cellspacing=" 1 "cellpadding=" 0 ">
Set table TD Background to White
CSS code:
<style>. table-d table{background: #F00}. table-d table td{Background: #FFF}///CSS Comment: Set table background is red, TD background is white */</ Style>
Corresponding HTML source code:
<div class= "table-d" > <table width= "" "border=" 0 "cellspacing=" 1 "cellpadding=" 0 "> <tr> <td Width= "" > Station name </td> <td width= "181" > URL </td> <td width= "A" > Description </td> </tr> <tr> <td>DIVCSS5</td> <td>www.divcss5.com</td> <td>css Learning </td> </tr > <tr> <td>CSS5</td> <td>www.css5.com.cn</td> <td>css </td> </tr > </table> </div>
We've summed up four ways to implement table table border styles, and we recommend using the third and fourth methods to resolve table border styles. I hope our methods are helpful and able to master, and use them flexibly when needed.
Related reading:
How to Set table borders on table and TD tricks
How to use CSS to set the TD border