css and tables

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

css and tables

Post by s.dot »

I have an app set up so that users can choose options from a table that is displayed like this:

Code: Select all

<table>
	<tr>
		<td>cell one</td>
		<td>cell two</td>
	</tr>
</table>
For the final display, I want to take this table and align it vertically, not horizontally. So the DISPLAY result would be the equivilant of:

Code: Select all

<table>
	<tr>
		<td>cell one</td>
	</tr>
	<tr>
		<td>cell two</td>
	</tr>
</table>
Is it possible to do this using css only? I'm not familiar enough with the application to write a new page, however if I could style it to display that way, I could achieve my desired result.

I've messed around with display: table-row, table-cell, and table-row-group, but so far no luck.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

How about using a styled unordered list?
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

What if you set the <td> "display" property to "block"?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

what you need to use is the correct CSS property: {vertical-align: middle;}

the TD should default to the correct display type (table-cell) - if you change it 'vertical-align' won't work
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Sounds pretty ugly to me. I would go with feyds solution, as it is the proper way to do it. There are tons of resources if one where to search for CSS LIST MENUS or something similar.
Post Reply