Solved

aligning information with headings in a table - easy and urgent

Posted on 2004-07-30
8
208 Views
Last Modified: 2011-09-20

Hi, if I have a table that displays headings with three fields of information for each heading like so:
|heading one|heading two|heading three|
|va |va |var  |va |va |var |va |va  |   var|

Ive tried numerous of doing ways of doing this but always end up with:
|heading one|heading two|heading three|
|va |va|var|va |va |var|va   |va|var |
ie the headings are not aligned with the information.

How can I write html code to achieve this?

Thank you
0
Comment
Question by:VolSpeak
  • 7
8 Comments
 
LVL 13

Expert Comment

by:flow79
ID: 11680609
<table summary="" border="1">
<thead>
      <tr>
            <th style="width: 266px;" colspan="3">Heading 1</th>
            <th style="width: 266px;" colspan="3">Heading 2</th>
            <th style="width: 266px;" colspan="3">Heading 3</th>
      </tr>
      <tr>
            <th>SubHeading 1</th>
            <th>SubHeading 2</th>
            <th>SubHeading 3</th>
            <th>SubHeading 4</th>
            <th>SubHeading 5</th>
            <th>SubHeading 6</th>
            <th>SubHeading 7</th>
            <th>SubHeading 8</th>
            <th>SubHeading 9</th>
      </tr>
      </thead>
      <tbody>
        <td>Data</td>
            <td>Data</td>
            <td>Data</td>
            <td>Data</td>
            <td>Data</td>
            <td>Data</td>
            <td>Data</td>
            <td>Data</td>
            <td>Data</td>
      </tbody>
</table>
0
 
LVL 13

Expert Comment

by:flow79
ID: 11680672
if you want all your headings to be one color (to seperate from the DATA) make it
<thead bgcolor="#ccffff">

0
 
LVL 13

Expert Comment

by:flow79
ID: 11680680
or else or HTML/CSS to style the table in any manner youd like.
0
 
LVL 13

Expert Comment

by:flow79
ID: 11680712
also, i just looked at my code, you need to add: <tr> tags around each row of td's like so:

     <tr>
          <td>Data</td>
          <td>Data</td>
          <td>Data</td>
          <td>Data</td>
          <td>Data</td>
          <td>Data</td>
          <td>Data</td>
          <td>Data</td>
          <td>Data</td>
      </tr>

Sorry about forgetting the tr
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 13

Accepted Solution

by:
flow79 earned 125 total points
ID: 11680746
you could also just keep on iterating it and making more and more subheading sets: such as (this is just to show you how far thead and tbody will go)

<table summary="" border="1" cellpadding="4">
<thead bgcolor="#ccffff">
      <tr>
            <th style="width: 266px;" colspan="9">Heading 1</th>
            <th style="width: 266px;" colspan="9">Heading 2</th>
            <th style="width: 266px;" colspan="9">Heading 3</th>
      </tr>
      <tr>
            <th colspan="3">SubHeading 1</th>
            <th colspan="3">SubHeading 2</th>
            <th colspan="3">SubHeading 3</th>
            <th colspan="3">SubHeading 4</th>
            <th colspan="3">SubHeading 5</th>
            <th colspan="3">SubHeading 6</th>
            <th colspan="3">SubHeading 7</th>
            <th colspan="3">SubHeading 8</th>
            <th colspan="3">SubHeading 9</th>
      </tr>
      <tr>
            <th>SubHeading 1</th>
            <th>SubHeading 2</th>
            <th>SubHeading 3</th>
            <th>SubHeading 4</th>
            <th>SubHeading 5</th>
            <th>SubHeading 6</th>
            <th>SubHeading 7</th>
            <th>SubHeading 8</th>
            <th>SubHeading 9</th>
            <th>SubHeading 1</th>
            <th>SubHeading 2</th>
            <th>SubHeading 3</th>
            <th>SubHeading 4</th>
            <th>SubHeading 5</th>
            <th>SubHeading 6</th>
            <th>SubHeading 7</th>
            <th>SubHeading 8</th>
            <th>SubHeading 9</th>
            <th>SubHeading 1</th>
            <th>SubHeading 2</th>
            <th>SubHeading 3</th>
            <th>SubHeading 4</th>
            <th>SubHeading 5</th>
            <th>SubHeading 6</th>
            <th>SubHeading 7</th>
            <th>SubHeading 8</th>
            <th>SubHeading 9</th>
      </tr>
      </thead>
      <tbody>
       <tr>
        <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
            <td><div align="center">DATA</div></td>
       </tr>
      </tbody>
</table>
0
 
LVL 13

Expert Comment

by:flow79
ID: 11692579
hello?  any response?
0
 
LVL 13

Expert Comment

by:flow79
ID: 11763288
did this help you VolSpeak?  I have provided code above and beyond your requirements.  Please respond.
0
 

Author Comment

by:VolSpeak
ID: 11852251

Sorry, i have very limited internet access and am just testing your response now, please be patient

Thanks :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now