Question

I've created a dgrid to work with a webmap I've created through ESRI's Javascript API. The dgrid is working fine, but I want it to be more apparent to users that they can click on a cell in the first column to pan to that particular record on the map. I've added a line to the CSS to style the text in the first column to blue with an underline, but it applies the style to the header in addition to the cell contents. I'd like to leave the header unstyled while styling the contents of the columns. Is this possible?

Sorry, I should have been more specific. This isn't a table, it's a dojo dgrid. An example of what I'm using is this: http://developers.arcgis.com/en/javascript/samples/fl_dgrid/. Users can click on a cell in the first column to pan to a feature, but there's nothing showing that that cell is clickable (hence why I want to style it).

The CSS I added to style the first column is as follows:

#grid { height: 100%; }
.dgrid { border: none; }
.field-id { cursor: pointer; 
  text-decoration:underline;
  color:blue;
}
Était-ce utile?

La solution

You can try with this in your css:

td.field-id { cursor: pointer; 
  text-decoration:underline;
  color:blue;
}

With this you make more specific your selector then it only affects the td with class field-id not the th with that class.

Autres conseils

what they say is correct, have a look at this Table ccs3

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top