Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

aligning information with headings in a table - easy and urgent

Posted on 2004-07-30
8
Medium Priority
?
218 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

971 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