Inline Block Elements
August 9, 2007 6:58 AM
Subscribe
HTML / CSS Gurus. I have a TABLE with a bunch of dynamic columns. The table may have 4, 7, or 20 columns. Each table column HEADER ( TH tag ) contains two inline elements, 1) a tiny image icon for sorting, and 2) a column description in text. I would like these two elements to sit next to each other and NEVER ON SEPARATE LINES, essentially putting them into an inline-block. Unfortunately, if the text in the corresponding TD tags are below a certain width, the browser will force the width of the column, and subsequently force the two inline elements of the TH onto two different lines. How can I prevent this from happening in IE & Firefox without explicitly declaring the width of the columns. I have to use a IMG element for my icons, and not a css background-image.
posted by kaizen to computers & internet (8 comments total)
1 user marked this as a favorite
Or even set a min-width and float the img to the right. that's how I would probably tackle it.
posted by twistedonion at 7:13 AM on August 9, 2007