SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Styleing tricks for <col> elements?

    Hey everyone

    I've got a table I'm styling, and I'll make a quick mockup
    HTML Code:
    <table>
    	<col/>
    	<col class="col2"/>
    	<tbody>
    		<tr>
    			<td>Row 1 column 1</td>
    			<td>Row 1 column 2</td>
    
    		</tr>
    		<tr>
    			<td>Row 2 column 1</td>
    			<td>Row 2 column 2</td>
    
    		</tr>
    
    	</tbody>
    </table>
    I'd like to use descendant selectors to style the TDs (or, other elements in the TDs, like anchors) using the column. However, I can't since the TD isnt really a descendant of the COL, is there a trick to doing something like this that I don't know about? Somehow connecting the COL and it's class to it's visible "children"
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have never even seen the <col> tag...
    Aaron Brazell
    Technosailor



  3. #3
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    don't you need to wrap cols up in a colgroup in order for them to be valid and work as intended ?
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure, redux. I wasn't under the impression that a colgroup is required, but that very well may be the case. Lemme validate that HTML and try the colgroup and get back w/you later. Thanks for the suggestion.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope - no change. The only difference between col and colgroup that I can figure is that colgroup is a "nestable" version of col.

    I suspect this is something that just can't be done - which is okay - just wanted to check into it first before writing it off.
    Last edited by beetle; Jul 24, 2003 at 16:31.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Since <col> isn't a visual element (its results are seen in <td> tags, but nowhere else), it can't be styled. You have to style the appropriate <td>s instead as far as I know.

    Edit:

    I should read thread dates before posting a reply


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •