Solved

aligning information with headings in a table - easy and urgent

Posted on 2004-07-30
8
214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 
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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Find out what you should include to make the best professional email signature for your organization.
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 learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

726 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