473,395 Members | 1,484 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using different widths for table cells.

Markus
6,050 Expert 4TB
Ello.

I'm trying to set the widths for my first three rows of cells and then have a bottom row with different cell widths. However, the first three rows take on the same widths as the bottom row.

Expand|Select|Wrap|Line Numbers
  1. <table>
  2.   <tr>
  3.     <td width="80%"> ... </td>
  4.     <td width="20%"> ... </td>
  5.   </tr>
  6.   <!-- 2 more rows like this. -->
  7.   <tr>
  8.     <td width="50%"> ... </td>
  9.     <td width="50%"> ... </td>
  10.   </tr>
  11. </table>
  12.  
Is there a way to do the above and have them retain their specified widths?
Apr 23 '09 #1
6 9905
drhowarddrfine
7,435 Expert 4TB
Yep. That's what tables do. Cause they're a table.

You can create more cells and combine cells together but you can't have variable width tables as you show. That's not what tables are for. Tables are never to be used for layout.
Apr 23 '09 #2
Markus
6,050 Expert 4TB
Of course. I was using them to straighten up the edges of a form, n what not.

Nevermind.

Thanks, doc.
Apr 23 '09 #3
Dormilich
8,658 Expert Mod 8TB
@Markus
isn't that what layout is about?
Apr 23 '09 #4
Markus
6,050 Expert 4TB
@Dormilich
It's much easier to

Expand|Select|Wrap|Line Numbers
  1. <table>
  2.   <tr>
  3.     <td><input ... ></td>
  4.     <td>Username</td>
  5.   </tr>
  6.   <tr>
  7.     <td><input ... ></td>
  8.     <td>Password</td>
  9.   </tr>
  10. </table>
  11.  
rather than using divs to keep everything aligned.
Apr 23 '09 #5
Dormilich
8,658 Expert Mod 8TB
what about floating the labels?
Apr 23 '09 #6
drhowarddrfine
7,435 Expert 4TB
Why would you need divs to keep it aligned. I never do so.
Apr 23 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Cedric Villat | last post by:
I'm messing around the width of a table and can't see to get it right. Let me explain what I am trying to do. I have 5 cells in 1 row. The first cell I would like to be 20% of the screen space. The...
12
by: Andrew Thompson | last post by:
I am developing a Periodic Table of the Elements as<DIV>s ..(chuckle - just kidding!) a <TABLE> at http://www.physci.org/test/chem/, or rather, the table itself is.....
0
by: Thomas Mlynarczyk | last post by:
Hello! I want a table-like layout (2 x 2 cells), but as it's not tabular data I want to do it with divs and CSS. Here's what I have come up with so far (using an HTML 4.01 Strict doctype): ...
3
by: Steve Sabljak | last post by:
I seem to having a little trouble getting a table to display correctly in both msie and firefox. I want to set the table and column widths in pixels, and have some cell padding too. The table...
2
by: 23s | last post by:
Given the following table structure, <table width=100%> <tr> <td>static</td> <td>static</td> <td>variable</td> <td>static</td> </tr> </table>
5
by: Garmt de Vries | last post by:
I have a table listing various translations of the titles of a set of books. Each row represents a book, each column represents a language. It looks like this: ...
3
by: Alex Maghen | last post by:
Hi. Is there any way to lock down the width of columns in a DataGrid so that even if the text in one of the rows of that column is very wide, it just gets cut off or something rather than causing...
5
by: vpravin | last post by:
Hi guys...i am a super noob with html and aspx.. i didnt start this project but i am modifying it... q: how do i change the width of a column: Thats the table which is within a text box ...
9
by: active | last post by:
If my table has a column of 200px and I insert an image of 300px the column expands to the image size. Can I make the column widths firm? Cut off the image, rescale it or have H scroll bars...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.