Can I convert a <ul> into a <table> with a pre-specified number of columns?
Posted: Fri, 2008-05-16 20:41
I want to display an array of customer logos on our web site. Even though I want the data displayed two-dimensionally, strictly speaking, this isn't 2-dimensional data. It would seem like a
- is the most appropriate way to display these logos.
Yet the logos are all different sizes, and when I display them as a list using display:inline, they don't line up vertically. Is this a case where I should use tables, even though I don't want to? (I get frustrated with all the excessive s.)
Even if I use something like display: table-cell to avoid all of the s, another problem crops up: I want the table to be of a particular dimension (say, 3 columns wide), and I don't know how to specify that. Is there a way to do so?
Thanks.


newbie
Posts: 5
Joined: 2007-10-16
Correction to previous post
Posted: Fri, 2008-05-16 20:43
Sorry for the confusion: I used some tags in my post that screw up the formatting. Here's how it should read:
I want to display an array of customer logos on our web site. Even though I want the data displayed two-dimensionally, strictly speaking, this isn't 2-dimensional data. It would seem like a ul tag is the most appropriate way to display these logos.
Yet the logos are all different sizes, and when I display them as a list using display:inline, they don't line up vertically. Is this a case where I should use tables, even though I don't want to? (I get frustrated with all the excessive trs and tds.)
Even if I use something like display: table-cell to avoid all of the trs and tds, another problem crops up: I want the table to be of a particular dimension (say, 3 columns wide), and I don't know how to specify that. Is there a way to do so?
Thanks.
Enthusiast
Posts: 222
Joined: 2008-03-16
I would work with an ul in
Posted: Fri, 2008-05-16 20:55
I would work with an ul in this case, defining a height and width on li. I am lacking experience and I am too lazy to try, but a margin: auto auto; should center them all. Other solution would be creating images with the same dimensions, and if it is just adding white space. But I don't know how many logos you have.
Guru
Posts: 2431
Joined: 2005-12-14
Location: Victoria British Columbia
If you want things to align
Posted: Sat, 2008-05-17 01:17
If you want things to align they all have to be the same size, fairly obviously. I wouldn't use display:inline; I would use float:left; and I would put an explicit size on the LI elements that's large enough to contain the biggest logo.
I could change my plea to guilty,
but I don't think it would stick.
Ed Seedhouse