Log in

View Full Version : Table borders



bubba.daniel
08-05-2005, 02:39 PM
How would you change the color of a table border, to where it looks similar to this.

http://tinypic.com/a15ll2.gif

but i want the border to blue.. it is blue in original context, and i want it to outline the outside of the table only, but i might use it to divide content later on so you can tell me how to do that too =).

HTML. Thankz for your help.

bubba.daniel
08-05-2005, 02:54 PM
I can deal with the border on the inside... all you have to do is make the border and make new rows, but i want to know how do you change it to blue.
and, do i have to use a special tag?

Twey
08-05-2005, 04:19 PM
border-color: attribute. border-color-left, border-color-right, border-color-top, border-color-bottom.

bubba.daniel
08-05-2005, 05:51 PM
what is the exact tag?

Twey
08-05-2005, 06:40 PM
It's not a tag, it's CSS.

bubba.daniel
08-05-2005, 10:15 PM
tables arent css...

and i found out the hard way, bordercolor="######" can do it
but, how do i make the lines very thin like the table in the image

Twey
08-06-2005, 07:07 AM
You use CSS. This is the point of CSS. I know, funnily enough, that "tables arent css." However, it's perfectly possible to apply CSS to an HTML element (i.e. the table) to make it look different to the default. Try border-width: (border-top-width: border-bottom-width: border-left-width: border-right-width:).

bubba.daniel
08-06-2005, 01:46 PM
Try border-width: (border-top-width: border-bottom-width: border-left-width: border-right-width:).

ok, i would insert this in the table tag?

and, in the parenthesis i dont need, but is just optional right?

thank you

Twey
08-06-2005, 02:10 PM
You can use border-width to change them all or individually using ordered keywords (border-width: 1px 2px 1px 6px) or, if you (like me) can never remember what order they're supposed to come in, you can use border-left-width, border-right-width, &c. to change each one individually.

There are three types of CSS: external, embedded and inline, much like Javascript.
External CSS is included in another text file, commonly with the .css extension and included in the document with <link rel="stylesheet" type="text/css" href="/path/to/file.css"/> in the head of the document.
Embedded CSS is enclosed within <style type="text/css"></style> tags in the head.
Inline CSS is set via the style= attribute of any tag. Unlike the other two types, inline CSS does not require you to specify the element to apply it to.
What you're talking about could be accomplished by inline CSS:
<table style="border-color:navy; border-width:2px;">
or external or embedded CSS, either to all tables in the page:

<style type="text/css">
table {
border-color: navy;
border-width: 2px;
}
</style>
or only to that table:

<style type="text/css">
table.thinborder {
border-width: 2px;
border-color: navy;
}
</style>...
<table class="thinborder">

CSS tutorial here (http://www.w3schools.com/css/default.asp).