Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html table and css

Status
Not open for further replies.

Davide77

Technical User
Mar 6, 2003
166
0
0
CH
Hi, I have a general question about table and css. I was trying to format a table by using css styles but i looked around a little bit and it seems that css can work without using tables... does someone can give me a good link on this topic?

thank you

davide
 
I don't understand this... CSS can work on any HTML element.

Do you think about page layouts that use DIV tags instead of tables? Please explain.
 
i was trying to find out how to affect html table by using css: for example i want a table that has the topmargin but not the bottom margin... but I don't know how to achieve this. My question: is it possible to affect html tables with css?, and in this case do you know a good site with the properties I can use...
If this is not possible how can use css to imitate a table layout?
 
There are a couple of tables specific css attributes, but most of them are used on just about any element. You could do the margins with the margin property applied to your table. Consult W3Schools for a very concise list of css attributes and their usage.
 
And taking the opportunity to type just a few words into Google will turn up many tutorial sites on the subject.

Search: CSS tutorial table example margin

Jeff
 

This is how you would get a table with a top border but no bottom border:

Code:
<html>
<head>
<style type="text/css">
#myTable {
	border-top: 2px #000000 solid;
	border-bottom: none;
}
</style>
</head>
<body>
	<table id="myTable">
		<tr>
			<td>abc</td>
			<td>def</td>
		</tr>
		<tr>
			<td>ghi</td>
			<td>jkl</td>
		</tr>
	</table>
</body>
</html>

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top