Click to See Complete Forum and Search --> : tables


shepa006
01-12-2003, 12:58 AM
does anyone know of a way to add color and or texture to a tables border?

meow
01-12-2003, 04:06 AM
Use CSS. :)

table { border: 2px solid red }
td { border: 2px dotted green }

http://www.w3.org/TR/REC-CSS2/box.html#propdef-border

A texture is harder... you could perhaps use a trick with a conaining table or DIV, add a little padding to it and use a background image. That way the image will show up only in the padding area and look like a border.

Stefan
01-12-2003, 07:26 AM
CSS 3 will have the option to use images for borders.

Support in current browsers are pretty non exsistant, so this will only help you 3-4 years from now.

If you need complicated texture borders abusing tables for layout is your only option.
Most not too complex borderlayouts are possible to do using CSS 2 though.