title: How do I style the td-elements in a table row upon dragging using jqueryui sortable
body: <p>Using jQueryUI sortable I am able to drag and drop rows in a table.
  I'd like to change the style of the row when dragging.</p>
  
  <p>An option found on the internet is the following:</p>
  
  <pre><code>start: function(event, ui) {
      $(ui.item).css({
        'border': '1px solid #F95658',
        'background-color': '#bbb'
      });
    },
  </code></pre>
  
  <p>This however does not let me style the borders or the background color of the cells.</p>
  
  <p>The same goes for the placeholder.</p>
  
  <p>Is there a way to style these?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("table tbody").sortable({
    axis: 'y',
    placeholder: "ui-sortable-placeholder",
    revert: true,
    helper: fixHelper,
    start: function(event, ui) {
      $(ui.item).css({
        'border': '1px solid #F95658',
        'background-color': '#bbb'
      });
    },
    stop: function(event, ui) {
      $(ui.item).css({
        //'background-color': '#fff'
      });
    }
  }).disableSelection();
  
  
  var fixHelper = function(e, ui) {
    ui.children().each(function() {
      $(this).width($(this).width());
    });
    return ui;
  };</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 500px;
    margin: 50px 0 0 50px;
  }
  
  td,
  th {
    border: 1px solid #cacaca;
    text-align: left;
    padding: 8px;
    background-color: #f5f5f5;
  }
  
  th {
    background-color: #dce0e3;
  }
  
  .ui-sortable-placeholder {
    background-color: #fff;
    outline: 0px dashed black;
    padding: 0px 0px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"&gt;&lt;/script&gt;
  
  &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/ui-lightness/jquery-ui.css" rel="stylesheet" /&gt;
  
  
  
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Company&lt;/th&gt;
      &lt;th&gt;Contact&lt;/th&gt;
      &lt;th&gt;Country&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Alfreds Futterkiste&lt;/td&gt;
        &lt;td&gt;Maria Anders&lt;/td&gt;
        &lt;td&gt;Germany&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Centro comercial&lt;/td&gt;
        &lt;td&gt;Francisco Chang&lt;/td&gt;
        &lt;td&gt;Mexico&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Ernst Handel&lt;/td&gt;
        &lt;td&gt;Roland Mendel&lt;/td&gt;
        &lt;td&gt;Austria&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Island Trading&lt;/td&gt;
        &lt;td&gt;Helen Bennett&lt;/td&gt;
        &lt;td&gt;UK&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Laughing Bacchus &lt;/td&gt;
        &lt;td&gt;Yoshi Tannamuri&lt;/td&gt;
        &lt;td&gt;Canada&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Magazzini Alimentari &lt;/td&gt;
        &lt;td&gt;Giovanni Rovelli&lt;/td&gt;
        &lt;td&gt;Italy&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>