CraZyDroiD
CraZyDroiD

Reputation: 7105

css for a specific table header

I have a table implemented using a third party library. There i have something like the below code when inspecting the elements.

<th class="" colspan="3">
   <span class="ant-table-header-column">
      <div>
          <span class="ant-table-column-title">
             GENERAL
          </span>
          <span class="ant-table-column-sorter"></span>
      </div>
   </span>
 </th>



<th class="" colspan="2">
       <span class="ant-table-header-column">
          <div>
              <span class="ant-table-column-title">
                 INFORMATION
              </span>
              <span class="ant-table-column-sorter"></span>
          </div>
       </span>
     </th>

I want to write a css class for th where colspan="3" . The colspan="3" part is the only difference between the code blocks. How do i write a custom class to override the css properties from the library?

Upvotes: 1

Views: 609

Answers (1)

Billy Brown
Billy Brown

Reputation: 2342

Use an attribute selector:

th[colspan="3"] {
   ...
}

Upvotes: 4

Related Questions