Click to See Complete Forum and Search --> : How to add background image just TD?


toplisek
04-07-2010, 05:12 AM
I enclose background image.
I like to add background just to listboxes.
How to do this?


Code is like:


<tr><td class="">Myfirstlistbox1:
<select name="colour">
<option value='0'>Choose car...</option>
<option value=''>Mercedes</option>
</select>
</td></tr>



<tr><td class="">Size:
<select name="measure">
<option value='0'>Choose colour…</option>
<option value=''>5m</option>
</select>
</td></tr>




This background is in the middle of table with many TR and TD.

Is this possible to manage and have BOTH TR within ONE background?

tirna
04-07-2010, 05:39 AM
Imo it would involve much less markup code and be easier to add a bg image to just the the elements you want if you didn't use tables for layout purposes.

toplisek
04-07-2010, 05:54 AM
Tell me more info

Major Payne
04-09-2010, 03:54 AM
Tableless Web Design: http://en.wikipedia.org/wiki/Tableless_web_design
How to convert manually your HTML tables to CSS: http://www.table2css.com/articles/convert-your-html-tables-to-css
Images, Tables, and Mysterious Gaps: https://developer.mozilla.org/en/Images,_Tables,_and_Mysterious_Gaps

tirna
04-09-2010, 04:27 AM
Tell me more info

Instead of using tables to arrange your web page's content you could use just the appropriate markup elements for your content and use css positioning or float to position elements on the page to create your layout. Tableless layouts generally have cleaner and leaner code.

For a given page layout, tables will generally involve more code than tableless layouts - especially if you start using nested tables.

Code using tables, and again with nested tables, is generally much more cluttered and generally harder to maintain as you are finding out indirectly as a result of your original post.

It's a personal choice whether to use tables or not. I prefer to not use tables for layout.