Table span( rows and columns)

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
lynchpin
Forum Commoner
Posts: 60
Joined: Mon Jul 21, 2008 1:31 pm

Table span( rows and columns)

Post by lynchpin »

Hello,
I have a problem displaying data in my table. I want to display some names in multiple columns under the same row. I got an example that spans the names into multiple rows, but i want them spanned to multiple columns, but i dont know if this is possible.

Here's the row span example;
--------------------------------------
<table>
<tr><td>Names</td>
<td>
<span class="smallfont">Some Name</span>
<span class="smallfont">Another name</span>
<span class="smallfont">Any other name</span>
</td>
</tr>
</table>
---------------------------------------

but i need the rows to span(columns) and form like a long single line sentence.


Thanks.
SteveC
Forum Commoner
Posts: 44
Joined: Thu Dec 04, 2008 2:39 pm
Location: Lansing, MI

Re: Table span( rows and columns)

Post by SteveC »

It'd help if you provide us with the code you're using for small font also.

I would think you'd need to include display:block in your style for the spans.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Table span( rows and columns)

Post by pickle »

What do you want it to look like? Can you draw a picture, complete with where you expect the table cell borders to be? As it is, your spans will be on one text line, but may be broken up into multiple lines by the browser if the table cell is too narrow.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
lynchpin
Forum Commoner
Posts: 60
Joined: Mon Jul 21, 2008 1:31 pm

Re: Table span( rows and columns)

Post by lynchpin »

I want the table to look something like this.

Table
**********************************************
| row 1 | Name1, Name2, Name3, Name4, Name5, Name6' |
-----------------------------------------------------------
| row 2 | NameA, NameB, NameC, NameD, NameE, NameF |
-----------------------------------------------------------
| row 3 | ........, ........., ..........................................' |
-----------------------------------------------------------
| row 4 | ...............................................................' |
-----------------------------------------------------------
| row 5 | ...............................................................' |
**********************************************

The hyphens at the end are just to help align this demo table.

Thanks.
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Table span( rows and columns)

Post by papa »

<table>
<tr>
<td colspan="3">Names</td>
</tr>
<tr>
<td>Some Name</td>
<td>Another name</td>
<td>I love Papa</td>
</tr>
</table>
Post Reply