Solved

<table>

Posted on 2012-03-10
5
174 Views
Last Modified: 2012-03-11
Hi I have the following structure for my <table> tag
6 rows

row1 has 2 columns
row 2 has 2 columns
row 3 has 6 columns
row 4 has 6 columns
row 5 has 5 columns
row 6 has 5 columns

The problem i am having is, the columns are of different width. I want the columns to be aligned in each row. This is not happening.

I used colspan=5 Does not help for row 2 column 2.

Is there a better way to align columns with different widths?
0
Comment
Question by:genius_geek
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:pdd1lan
ID: 37704736
<table>
    <tr>
          <td colspan="3"></td>
         <td colspan="3"></td>
   </tr>
<tr>
          <td colspan="3"></td>
         <td colspan="3"></td>
   </tr>
<tr>
          <td colspan="1"></td>
         <td colspan="1"></td>
         <td colspan="1"></td>
          <td colspan="1"></td>
         <td colspan="1"></td>
          <td colspan="1"></td>
   </tr>
<tr>
          <td colspan="1"></td>
         <td colspan="1"></td>
         <td colspan="1"></td>
          <td colspan="1"></td>
         <td colspan="1"></td>
          <td colspan="1"></td>
   </tr>
<tr>
          <td colspan="2"></td>
         <td colspan="1"></td>
         <td colspan="1"></td>
          <td colspan="1"></td>
         <td colspan="1"></td>
   </tr>

<tr>
          <td colspan="2"></td>
         <td colspan="1"></td>
         <td colspan="1"></td>
          <td colspan="1"></td>
         <td colspan="1"></td>
   </tr>
</table>
0
 

Author Comment

by:genius_geek
ID: 37704752
i tried that. I will tell you why it does not work.

row 2 has two input type=text (column1 and column2) each textbox with size is 25
row 4 has 6 textboxes, 1st with size 25, 2nd 3rd 4th with size 2, 5th and 6th with size 7

in the above mentioned case, r2c2 and r2c3 will be faaaaaar apart. how would you solve that?
0
 

Author Comment

by:genius_geek
ID: 37704758
also 1st and 2nd row is spilt as 1,5 and not 3,3
0
 
LVL 8

Accepted Solution

by:
pdd1lan earned 500 total points
ID: 37704774
I put row 2 and row 6 as you mentioned, and looks align up to me.  I misunderstand your question.
 
  <tr>
          <td colspan="1"><input type="textbox" name="t1" size="25"></td>
         <td colspan="5"><input type="textbox" name="t2" size="25"></td>
   </tr>
<tr>
          <td colspan="1"><input type="textbox" name="t2" size="25"></td>
         <td colspan="1"><input type="textbox" name="t2" size="2"></td>
         <td colspan="1"><input type="textbox" name="t2" size="2"></td>
          <td colspan="1"><input type="textbox" name="t2" size="2"></td>
         <td colspan="1"><input type="textbox" name="t2" size="2"></td>
          <td colspan="1"><input type="textbox" name="t2" size="7"></td>
   </tr>
<tr>
0
 
LVL 8

Expert Comment

by:pdd1lan
ID: 37704792
have to try to align the field to the left:

<style type="text/css">
  td {text-align:left;"}
</style>
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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