JSFiddle - React, Tailwind, and code Playground

by Rahul Sharma

HTML

<table class="myTable">
    
    <tr>
        <td>rahul</td>
        
    </tr>
</table>

CSS

.myTable
{
   background : black; color:white;
}

JavaScript

(function($) {
    $.extend($.fn, {
        makeCssInline: function() {
            this.each(function(idx, el) {
                var style = el.style;
                var properties = [];
                for(var property in style) { 
                    if($(this).css(property)) {
                        properties.push(property + ':' + $(this).css(property));
                    }
                }
                this.style.cssText = properties.join(';');
                $(this).children().makeCssInline();
            });
        }
    });
}(jQuery));


$('.myTable').makeCssInline();