HTML_TABLE內外邊框顏色設置及頁面居中


HTML_TABLE內外邊框顏色設置及頁面居中
 
時間: 2009.05.07 11:32:00 
標簽:  
<table width="100%"  cellpadding="0" cellspacing="0" bgcolor="#a1a1a1" id="table2">---此處設置外邊框顏色
<tr >
<td bgcolor="#ffffff" colspan="6" height="25" align=center><font color=#ea5e01 size=3><strong>房屋基本信息</strong></font></td>
</tr>          
<tr>
<td bgcolor="#E6E6FA" height="25" width="13%" align=center>房屋狀態</td>
<td bgcolor="#ffffff" width="20%" valign=center  >---此處設置單元格邊框顏色
$TYPE$</td>
<td bgcolor="#E6E6FA" width="13%" align=center >房屋類別</td>此處設置單元下邊框顏色
<td bgcolor="#ffffff" width="20%" valign=center >$FWLB$</td>
<td bgcolor="#E6E6FA" width="13%" align=center>所在地區</td>
<td bgcolor="#ffffff" width="20%" valign=center >$XS$</td>
</tr></table>


bordercolor="#254389"----設置所有邊框顏色

style= "border:1px solid #000000;border-right-color:#FF0000;"
整體加邊框: border:1px solid #000000;   1PX為邊框大小,#000000為顏色! 
只給某一邊加邊框: 右邊框 border-right-color:#FF0000; 
左邊框 border-left-color:#FF0000; 
上邊框 border-top-color:#FF0000; 
下邊框 border-bottom-color:#FF0000; 



HTML:table表格畫線控制
2008年03月12日 星期三 20:44
一、表格中單元格之間分隔線的隱藏方法
這個表格去掉了單元格之間的縱向分隔線

這個表格去掉了單元格之間的橫向分隔線
 
 
這個表格去掉了單元格之間的縱向分隔線和橫向分隔線

其實上面的三個表格都有三行三列,隱藏分隔線的訣竅在於rules,察看這三個表格的源代碼,我們可以看到<TABLE>標簽中都有 rules。 它有三個參數(cols,rows,none),當rules=cols時,表格會隱藏縱向的分隔線,這樣我們就只能看到表格的行;當rules= rows時,則 隱藏了橫向的分隔線,這樣我們只能看到表格的列;而當rules=none時,縱向分隔線和橫向分隔線將全部隱藏。



二、表格邊框的隱藏
這是一普通的表格

不怕 下雨
   
只顯示上邊框
   
下起雨來 該怎么辦
只顯示下邊框

上不着天  
  下不着地
只顯示左、右邊框
  兩邊走開
老子姓王  
只顯示上、下邊框

左右  
為難  
只顯示左邊框
  左右
  為難
只顯示右邊框

光禿禿  
  全脫了
不顯示任何邊框

表格邊框的顯示與隱藏,是可以用frame參數來控制的。請注意它只控制表格的邊框圖,而不影晌單元格。
只顯示上邊框 <table frame=above>
只顯示下邊框 <table frame=below> 
只顯示左、右邊框 <table frame=vsides>
只顯示上、下邊框 <table frame=hsides>
只顯示左邊框 <table frame=lhs>
只顯示右邊框 <table frame=rhs>
不顯示任何邊框 <table frame=void>

 

三、表格邊框
這是一普通的表格
<table border="1" width="200" cellpadding="0" cellspacing="0"> <tr align="center">   <td>普</td> <td>表</td> </tr> <tr align="center">   <td>通</td> <td>格</td> </tr> </table>  
表格加上了漂亮的細線
(利用cellspacing1像素間隙和表格與單元格背景的不同)
<table border="0" width="200" cellspacing="1" cellpadding="0" bgcolor="#000000" > <tr align="center" bgcolor="#FFFFFF">   <td bgcolor="#FFFFFF">細</td> <td bgcolor="#FFFFFF">表</td> </tr> <tr align="center" bgcolor="#FFFFFF">   <td bgcolor="#FFFFFF">線</td> <td bgcolor="#FFFFFF">格</td> </tr> </table>  
這和上面那個可不一樣,它用的是CSS,效果卻一樣。
(對單元格border的定義)
<table width="200" cellspacing="0" cellpadding="0"> <tr align="center">   <td >細</td> <td >表</td> </tr> <tr align="center">   <td >線</td> <td >格</td> </tr> </table>  
再進一步,把邊框變成虛線,同樣是CSS的神奇作用。
<table width="200" cellspacing="0" cellpadding="0"> <tr align="center">   <td >細</td> <td >表</td> </tr> <td >線</td> <td >格</td> </tr> </table>  
 
 
 
 
細線表格的擴展應用,奧妙就是在第個單元格中再套入一個表格。
<table width="200" border="0" cellspacing="2" cellpadding="0"> <tr>   <td>     <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">    <tr>     <td bgcolor="#FFFFFF"> </td>    </tr>    </table> </td> <td>      <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">     <tr>      <td bgcolor="#FFFFFF"> </td>     </tr>     </table> </td> </tr> <tr>   <td>       <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">      <tr>       <td bgcolor="#FFFFFF"> </td>      </tr>      </table> </td> <td>       <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">      <tr>       <td bgcolor="#FFFFFF"> </td>      </tr>      </table> </td> </tr> </table>  
立體感的表格
(簡單的亮暗邊框設置,注意只有IE支持這種效果)
<table border="1" bordercolorlight="#ffffff" bordercolordark="#ffffff" width="200" cellpadding="0" cellspacing="0"> <tr align="center">   <td bgcolor="#B7B7B7"   bordercolorlight="#000000" bordercolordark="#eeeeee" >立</td> <td bgcolor="#B7B7B7"   bordercolorlight="#000000" bordercolordark="#eeeeee" >表</td> </tr> <tr align="center">   <td bgcolor="#B7B7B7"   bordercolorlight="#000000" bordercolordark="#eeeeee" >體</td> <td bgcolor="#B7B7B7"   bordercolorlight="#000000" bordercolordark="#eeeeee" >格</td> </tr> </table>  
無名表格
給表格加上一個表頭
(應用<fieldset>和</legend>標簽)
<table width="200" cellpadding="0" cellspacing="0"> <tr>   <td><fieldset align="center"> <legend> 無名表格 </legend>   <p align="right">   </fieldset></td> </tr> </table>  
表中表效果Ⅰ
給表頭再加個框
(用CSS為<legnd>定義一個邊框)
<table width="200"" cellspacing="0" cellpadding="0"> <tr>   <td> <fieldset align="center">   <legend > 表中表效果Ⅰ</legend>   <br> </fieldset> </td> </tr> </table>  
表中表效果Ⅱ
看起來和上面的一樣,可是這個才是真正的表中表哦。
(在<legnd>中插入一個表格)


<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 HTML設置頁面居中的五種方式 HTML布局排版2如何設置div總是相對於頁面居中 css盒模型。邊框和內外邊距 flutter TextField 外邊框顏色 div頁面居中方法 HTML 學習筆記 CSS樣式(外邊框 外邊框合並) 生成excel整理(設置邊框/字體/顏色/加粗/居中/) CSS盒子模型之邊框,內外邊距詳解
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM
標簽隱藏內邊框與外邊框 css:盒子模型邊框(邊框、內外邊距)