Web-based html + CSS (1) --- Implementation of the Forum homepage table and css Forum Homepage
Reprint please explain the source, small blog address: http://blog.csdn.net/u012116457
Recently I wanted to write a page similar to a Forum. The Forum homepage usually needs a table to display the data. I wrote it briefly and first made a picture.
Css code:
/* Basic information */body {margin: 0px;/* margin */text-align: left;/* align text in center */font-family: 'trebuchet Ms ', 'lucida sans ', Arial; font-size: 14px; background: # E1D0BB;/* background Color */}/* Page layer container */# container {width: 70%; height: 100%; margin-left: 15%; margin-right: 15%; background: # ABE0F1;}/* header */# header {width: 100%; height: 30%; margin: 0px; background: # ffffff;}/* Page subject */# pageBody {width: 100%; height: 70%; margin: 0px; background: # ffFFFF ;} /* Total table */table {* border-collapse: collapse;/* IE7 and lower */border-spacing: 0;/* No split line is displayed between columns */width: 100% ;}. zebra td ,. zebra th {padding: 8px;/* control the height of each row in the table */border-bottom: 1px solid # FFFFFF;/* width and color of the boundary of each row */}. zebra tbody tr: nth-child (even) {background: # f0f0f0;/* color of an even row, that is, set the color of two adjacent lines to different */-webkit-box-shadow: 0 1px 0 rgba (255,255,255 ,. 8) inset;/* Set shadow */-moz-box-shadow: 0 1px 0 rgba (255,255,255 ,. 8) inset; box-shadow: 0 1px 0 rgba (255,255,255 ,. 8) inset;}/* Header style setting */. zebra th {text-align: left;/* left-aligned text */text-shadow: 0 1px 0 rgba (255,255,255 ,. 5); border-bottom: 1px solid # ccc; background-color: # eee ;}. zebra tr td a: link ,. zebra tr td a: visited {font-size: 15px; text-decoration: none; color: blue;/* usual color */}. zebra tr td a: hover {font-width: 800; text-decoration: underline; color: red;/* hovering color */}/* bottom of the table */. zebra tfoot td {border-bottom: 0; border-top: 1px solid # fff; background-color: # f1f1f1;}/* a small table used to display the number of pages */. pageTable {widthborder = 0;}/* footer */# footer {width: 100%; height: 10%; margin: 0px; background: # FFFF00 ;}
Html code:
<! DOCTYPE html>
The border display of an html + css table is a double line. How does it become like a table in word?
You can use border: 1px solid #333 for CSS styles!
Or you can set them one by one.
Border-top: 1px solid #333;
Border-right: 1px solid #333;
Border-bottom: 1px solid #333;
Border-left: 1px solid #333;
Hope to help you
On a jsp page, you can use html + css or js to write a table. A title is displayed, and a table appears. It looks like a page.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "www.w3.org/..al.dtd">
<Html xmlns = "www.w3.org/5o/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<Style>
. Span {width: 100px; border-right: #000000 1px solid; text-align: center; color: #000000; float: left; cursor: hand}
Div. border {border: #006699 1px solid; width: 400px; position: absolute; display: none}
</Style>
<Script language = "javascript">
Var currObj;
Var currContentObj;
Function changTitle (I)
{
CurrObj. style. color = "#000000 ";
CurrObj = document. getElementById ("xp" + I );
CurrObj. style. color = "# CC6699 ";
CurrContentObj. style. display = "none ";
CurrContentObj = document. getElementById ("content" + I );
CurrContentObj. style. display = "block ";
}
</Script>
</Head>
<Body>
<Div style = "display: block; float: none; width: 100%">
<! -- Title -->
<Div id = "xp1" onclick = "changTitle (1)" style = "color: # CC6699; "class =" span "> Title 1 </div> ...... remaining full text>