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.

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


Solution :

Just use

table thead th[colspan]

According to the CSS 2.1 spec,


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

    CSS Howto..

    How to choose second and third element (li) in
      tag (with CSS)?

    How to write this CSS-Selector (Target img from previous Anchor-Tag)

    How do I make an element the height of the browser window?

    How to add a CSS class to an element using a jQuery Selector?

    How to apply css to only one level of list items (not to child elements)

    How to create
    with special form in CSS or Javascript

    CSS - how to overwrite using CSS?

    How to increase the duration of :active in css?

    How to wrap text inside an iframe with designMode on, using css and also javascript if necessary?

    show hover by default using CSS

    How to get tr:nth-child which has css applied

    (HTML/CSS) How do I repeat items like on Google or Reddit?

    How to position text on a baseline?

    Does anyone know how to create this 3d flip animation via CSS?

    How to override css img properties?

    How to make a CSS menu to remain visible after a child has been clicked on

    How can I set the correct position of the text in CSS?

    How to achieve the following navigation with CSS and HTML

    how to make header title with buttons

    How To Apply jQuery CSS Selector

    php css how to change name color based on membership?

    How to apply CSS to the first letter after :before content?

    how to set button background such that it takes up height and width of parent div? what css property affects which dimension?

    How to Add custom Css Clases to PyroCMS contact form elements

    CSS (Fixed width right, fluid left, left is first in html) How do I keep left div from collapsing?

    CSS - How to force elements to 100% of remaining/available space of parent element without extending beyond it?

    Text Underline Showing Underline

    How to make footer responsive through CSS?

    How can I center a button in the cell of a table using CSS ASP.NET

    How to change tooltip style in jQuery vmap?