/    Sign up×
Community /Pin to ProfileBookmark

Forcing IE to stack <td> elements vertically

I have a shopping cart that I have no control over the html that is generated. It returns the searched for products in a 3-wide table format. My client wishes to have it be a vertical list instead (1-wide). With all browsers except IE, I simply put

#shoppingcart td { display: block; }

and everything was perfect, but I have yet to figure out any combination of CSS that will make IE stack <TD> elements on top of each other.

Any help?

Gregory Love

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@Andyram2kAug 16.2009 — Hi togreglove,

This would just be a matter of setting the TD to 100&#37; and float: left, and this should solve your issue.

[CODE]<style>
TD {
width: 100%;
float: left;
}
</style>

<table width="100%" border="0">
<tr>
<td>test</td>
<td>test 2</td>
<td>test 3</td>
</tr>
</table>[/CODE]





Hope this helps ?
Copy linkTweet thisAlerts:
@togregloveauthorAug 16.2009 — I tried your code, and unfortunately, IE makes the first cell 100%, then shoves the other two cells off the right margin in tiny boxes.

I don't think IE lets TD's float.
Copy linkTweet thisAlerts:
@Andyram2kAug 17.2009 — Hi togreglove,

The correct method would be to either use single columns and repeat rows, or exchange for DIVs. It's not really in the nature of TD tags to go underneath each other, so probably won't work in all browsers.

Is there no way you can edit the source files of the shopping cart?
×

Success!

Help @togreglove spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...