$(function(){ var tw = $('#com-tbl'); if(tw.attr('id') != undefined){ $('.read-text').css('width', tw.width() * 0.95+'px'); } });