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;
}
有帮助吗?

解决方案

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.

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top