table border attribute

R

rodchar

hey all,
is it possible to make the table border attribute dynamic? For example, is
there a way to make it where i can set it in a style sheet?

thanks,
rodchar
 
N

Nathan Sokalski

Sure, just use the CSS border property. For example:

<table style="border:2px solid black;">

would give the table a solid black border with a width of 2px. You can
obviously also use the other CSS border properties, such as border-width,
border-style, border-color, etc. Something that I often do when modifying
borders in tables is place the styles for the borders in the individual td
tags so that I can do more customization for the table's appearance, but
this can depend on your specific situation.
 
S

Sam Allen

You could dynamically add text to a stylesheet so that you can change the
border style based on some arbitrary logic. Style1.InnerText += "table {
border: solid 1px black; }". That works well if you are using master pages
and content pages. (Style1 is the id of the style element.)

Sam
http://dotnetperls.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top