Solved

<table>

Posted on 2012-03-10
5
167 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

759 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

17 Experts available now in Live!

Get 1:1 Help Now