Accepted answer

By styling not applied, I assume you are referring to the table-hover class. For that to work you need a proper table with a <tbody> attribute:

var container ="body")
  .append("table").attr("class","table table-hover")

Full code:

<!DOCTYPE html>
<html lang="en">

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script>



  <script src="//" charset="utf-8"></script>

  <script type="text/javascript" charset="utf-8">
    //d3.text("data.csv", function(data) {

    var data = "header1,header2,header3\r\na,b,c\r\nd,e,f\r\n";

    var parsedCSV = d3.csv.parseRows(data);

    var container ="body")
      .append("div").attr("class", "container")
      .append("table").attr("class", "table table-hover")


      .data(function(d) {
        return d;
      .text(function(d) {
        return d;


Related Query

More Query from same tag