473,795 Members | 2,922 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using different widths for table cells.

Markus
6,050 Recognized Expert Expert
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 9925
drhowarddrfine
7,435 Recognized Expert Expert
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 Recognized Expert Expert
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 Recognized Expert Moderator Expert
@Markus
isn't that what layout is about?
Apr 23 '09 #4
Markus
6,050 Recognized Expert Expert
@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 Recognized Expert Moderator Expert
what about floating the labels?
Apr 23 '09 #6
drhowarddrfine
7,435 Recognized Expert Expert
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
2827
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 middle 3 cells are filled with text and will be whatever width the text is (so no width specified). Then I want the last cell to just fill in the rest of the screen. What I have now is: <table width="100%"> <tr> <td width="20%"></td>
12
3512
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.. http://www.physci.org/test/chem/ptoe.html It contains valid HTML and CSS (checked 'moments' ago). Am testing in IE 6 on XP. My questions..
0
3129
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): div.table {position:relative; width:100%;} div.row {clear:both; padding-top:2%;} div.left {float:left;} div.right {float:right;}
3
10715
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 displays correctly in standards compiance mode in firefox, but not msie, where the padding is added on to the column widths. the table size is always correct, but the column widths are not what I expect them to be. If I change the column widths to...
2
18210
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
1809
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: +-------------------+------------------+-------------------+ | Français | English | Deutsch | +-------------------+------------------+-------------------+ | Le tour du monde | Around the world | Die Reise um die | | en 80 jours | in 80 days ...
3
1966
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 the column to get wider? The problem is that even if I set the column to wrap text, sometimes a single "word" or string is very long without any spaces and therefore doesn't wrap but just forces the column wider - and that's not what I want. ...
5
1956
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 <asp:Table id="regulatoryDetails" runat="server" Font-Size="X-Small" Width="400px" Height="8px"
9
1157
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 would do. Any suggestions?
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10215
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.