Align table with header

2

How do I centralize the product table? The table has no Id nor Class.

I wanted to get the table through the javascript and modify the width of it to stay in line with the header.

But she has no id or class. I can only modify the header and page footer, so it has to be via javascript.

www.potinhodemel.com.br

    
asked by anonymous 12.08.2014 / 22:05

1 answer

0

It's basically:

// CSS
h1{background:#FF0000}
table{background:#FFCC00}


// HTML
<h1>Heading</h1>

<table style="width:300px">
<tr><td>Teste</td></tr>
</table>


// JS
$( document ).ready(function(){
    $( 'table' ).width( $( 'h1' ).width() )
});

Demo running: jsfiddle

    
13.08.2014 / 07:09