Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

repeater with columns

Status
Not open for further replies.

fpower

MIS
Aug 12, 2003
54
US
Hi everyone,

I am new to programming so any guidance will be greatly appreciated.
I am trying to use a repeater to return data to a table similar to this...
Dimensions:
2 Seat Sofa 3 Seat Sofa
---------------------- ----------------------
Width 72" Width 96"
Height 33" Height 33"
Depth 33" Depth 33"
Seat Height 16 1/2" Seat Height 16 1/2"

I have been able to get the repeater to work but it puts the data below each, like this...

2 Seat Sofa
--------------------
Width 72"
Height 33"
Depth 33"
Seat Height 16 1/2"
3 Seat Sofa
---------------------
Width 96"
Height 33"
Depth 33"
Seat Height 16 1/2"

Any idea how I can get it to display next to each other?

Thanks in advance!
 
Yes, you would generally float each set of elements next to each other (although it will depend on what HTML you are you using). Read up on floating and if you have any problems try asking in the HTML forum.

Mark,

[URL unfurl="true"]http://lessthandot.com[/url] - Experts, Information, Ideas & Knowledge
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Website Design
[URL unfurl="true"]http://aspnetlibrary.com[/url] - An online resource for professional ASP.NET developers
 
I know Mark will hate this answer, but since you can use any HTML within the repeater, you can use a table as well.
 
Hi Guys,

Thanks for the replys... I tried using the float, but it turned out to be a little disasterous for me. The table worked a little better, as it displayed the info like this:

Height: 123 Weidth: 456 Height: 1234 Weidth: 5678

However, I was hoping it would like this:

Width 72" Width 96"
Height 33" Height 33"

Here is the code I am using:
<table>
<asp:Repeater ID="repeatDimensions" runat="server">
<ItemTemplate>
<td>
<%# DataBinder.Eval(Container.DataItem,"dimensionsTitle") %>
</td>
</ItemTemplate>
</asp:Repeater>
</table>

I am pulling the data from an sql database with the following code:

SELECT
d.dimensionsTitle + ': ' + d.dimensionsDescription AS dimensionsTitle
FROM tbldimensions as d
WHERE d.productID = @productID

The data fields in the database are the following:
productID, model, descriptionTitle, dimensionsDescription

Do I need to make changes to the database? Is there a possible way to acheive my goal using html/c# code?

Any help would be greatly appreciated. And thanks again for the help!
 
Where are your <tr> tags?

you have
<table>
then
<td>

That is not correct HTML.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top