AlexM
AlexM

Reputation: 203

DIV to match width of TABLE

I have a container DIV. Inside the container are three elements. Two banner DIV's (simulating a header and footer) and a TABLE. The TABLE is enormously wide. There is no way to get around the horizontal scrolling and I must have the banners background color extend to match the full length of the DIV. How do I have the DIV expand its width to the entire width of the TABLE and why is the TABLE not affecting the width of its parent DIV?

thank you.

See my jsfiddle

Upvotes: 2

Views: 2028

Answers (1)

Royce Feng
Royce Feng

Reputation: 1663

Removing the width: 100% and adding display: inline-block to the container element should do it. http://jsfiddle.net/rqJQg/6/

Upvotes: 7

Related Questions