How to CSS select all cells with colspan set?


Tags: css,css3,css-selectors

Problem :

I would like to select all cells in the table header which have the colspan attribute set.

Of course I could do something like:

 table thead th[colspan="1"],
 table thead th[colspan="2"],
 table thead th[colspan="3"] {

 }

but I'm looking for something like this:

 table thead th[colspan*=""] {

 }

which does not seem to work.

Question:
How to select all cells with colspan set in a table?

Thanks!



Solution :

Just use

table thead th[colspan]

According to the CSS 2.1 spec,

[att]

Match when the element sets the "att" attribute, whatever the value of the attribute.


    CSS Howto..

    CSS - How to avoid element content to be displayed on 2 lines

    How to positioning an element over another in CSS

    Grails: How do I use the resources plugin to add a CSS “link” tag into the head?

    How to change css on link current class

    CSS - How to make a div as wide as a containing child img

    How does positioning work in HTML/CSS?

    How to overcome Selenium CSS parent only CSS selector limitation

    CSS: how to layout 3 columns, 2 are optional

    How to contain a scrollable div element completely within another?

    How to layout list items in groups

    How to change css pseudo elements in javascript? [duplicate]

    How to find a div / panel in repeater and apply css?

    How to make CSS input range thumb not appear at first

    How can I make a button apply a class to the next div in the document flow?

    How to fit elements in 100% width without absolute positioning?

    How can I make clickable list with sublinks ?

    How can I wrap this text so it doesn't overflow past the widget container?

    how to crop images that has any size using css

    Yahoo news CSS, how to achieve behavior

    How to differentiate between two class of same name in different css on same page

    css: How to make elements not to overlap + automatically place them in a relevant position

    How to overwrite css style in a specific page?

    How to make ComboBox caption bold in Vaadin?

    How to create full height content section with fixed header and footer in CSS with scrollbar hidden if not required [closed]

    custom radio button show value inside

    How can I stretch my navigation and content area height to 100% in CSS?

    How do I use CSS to select for a tag with arbitrary name attribute?

    How to make a
  • link visited with css
  • How quora put that image on their home page? [closed]

    How do I get this dropdown to be on top of the other elements