• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

spanning a data cell w/o headers

Hi EEE:
Given an array of column name, array of column values and an array of comments, i would like
to display in an HTNL page in the following way:

-----------------------------------------------------
ColumnName1 | ColumnName2 | ColumnName3 | ColumnName4        
-----------------------------------------------------
columnvalue1a| columnValue2a|columnvalue3a | columnvalue4a
-----------------------------------------------------
      1. comment1a
        2. comment2a
-----------------------------------------------------
columnvalue1b| columnValue2b|columnvalue3b | columnvalue4b
-----------------------------------------------------
      1. comment1b
        2. comment2b

My implementation looks like
<table>
<tr><td>ColumnName1</td><td>ColumnName2</td><td>ColumnName3</td><td>ColumnName4</td>
<tr><td>ColumnValue1a</td><td>ColumnValue2a</td><td>ColumnValue3a</td><td>ColumnValue4a</td>
<tr><td><ol> <li>comment1a</li> <li>comment2a</li> </ol></td></tr>
 
So, far I am having difficulty in the following subsections
1. The third part shows the numbered list of comments but its width is restricted to the column1's width. How can I get it to span all the columns?

2. How can I set the width of the table to 2 rows and rest of the row wraps around, like so?

-----------------------------------------------------
ColumnName1 | ColumnName2 |
ColumnName3 | ColumnName4        
-----------------------------------------------------
columnvalue1a| columnValue2a|
columnvalue3a | columnvalue4a
-----------------------------------------------------
0
LuckyLucks
Asked:
LuckyLucks
  • 3
1 Solution
 
jasonsbytesCommented:
use:  colspan="2" in the <td> tag.

<td colspan="2">
or to span 3 cols
<td colspan="3">
0
 
jasonsbytesCommented:
In your example above it looks like you need:
<tr><td colspan="4"><ol> <li>comment1a</li> <li>comment2a</li> </ol></td></tr>
0
 
jasonsbytesCommented:
btw, for readability you should write it like:
<table>
   <tr>
      <td>
         ColumnName1
      </td>
      <td>
         ColumnName2
      </td>
      <td>
         ColumnName3
      </td>
      <td>
         ColumnName4
      </td>
   <tr>
      <td>
         ColumnValue1a
      </td>
      <td>
         ColumnValue2a
      </td>
      <td>
         ColumnValue3a
      </td>
      <td>
         ColumnValue4a
      </td>
   <tr>
      <td>
         <ol>
            <li>comment1a</li>
            <li>comment2a</li>
         </ol>
      </td>
   </tr>
</table>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now