Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > setting table column attributes

Reply
Thread Tools

setting table column attributes

 
 
ppcguy
Guest
Posts: n/a
 
      08-13-2005
is there a way to set table column attributes (e.g. background-color)
just once...as opposed to going into each <TD> for that column.

css preferable.


 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      08-13-2005
ppcguy wrote:

> is there a way to set table column attributes (e.g. background-color)
> just once...as opposed to going into each <TD> for that column.


No -- table inheritance only works for rows.

So you can, for example, set the background for every cell in a particular
row, like this:

<style type="text/css">
TR.yellowrow TD { background:yellow }
</style>

<tr class="yellowrow">
<td>a</td>
<td>b</td>
<td>c</td>
</tr>

However, you can use the <colgroup> and <col> elements near the top of
your table to set border colours, widths and styles, and default
alignments.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      08-13-2005
ppcguy wrote:

> is there a way to set table column attributes (e.g. background-color)
> just once...


No.

> as opposed to going into each <TD> for that column.
>
> css preferable.


Well you can set CSS properties, but they aren't attributes

http://css-discuss.incutio.com/?page=StylingColumns

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      08-14-2005
With neither quill nor qualm, ppcguy quothed:

> is there a way to set table column attributes (e.g. background-color)
> just once...as opposed to going into each <TD> for that column.
>
> css preferable.


Yes if you class the td's and set class color in the style sheet. This
is assuming you want different colors for different columns.

--
Neredbojias
Contrary to popular belief, it is believable.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net 0 04-12-2007 03:11 PM
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net Web Controls 0 04-12-2007 02:40 PM
setting Column width of Template Column in Datagrid.. Charleees ASP .Net 2 06-20-2006 12:52 PM
Problem with comparing a Table View Column with the Table Column? savvy ASP .Net 1 01-18-2006 03:04 PM
Sort Column In Table (ascending) Using attributes AwanJohnie XML 1 10-02-2004 04:36 PM



Advertisments