?
Solved

<table>

Posted on 2012-03-10
5
Medium Priority
?
179 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

850 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