0

I have this table:

<table>
    <thead>
        <tr>
            <th>Example 1</th>
            <th>Example 2</th>
            <th>Example 3</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Example text 1</td>
            <td>Example text 2</td>
            <td><input type="text" /></td>
        </tr>
    </tbody>
</table>

I want to apply styles only to tds that don't include input tag.

How to do that?

Michael Benjamin
  • 265,915
  • 79
  • 461
  • 583
smartmouse
  • 11,808
  • 26
  • 77
  • 154
  • 1
    You can't do that with CSS alone. CSS selectors cannot select an element depending on whether it has a specific child or not (atleast not yet). – Harry Dec 30 '15 at 11:34
  • Are there any other unique qualities of the `td` with `input` child? Such as, is it always the last `td` in the row? – Michael Benjamin Dec 30 '15 at 11:40
  • No, it isn't always the last td in the row :( – smartmouse Dec 30 '15 at 11:49
  • 1
    Well, unless there's another quality that can be targeted, then it is solely a parent selector scenario, which unfortunately CSS cannot do (but Javascript can). – Michael Benjamin Dec 30 '15 at 11:54

0 Answers0