October 25th, 2012, 08:51 AM
<td width> not working
For example, I would have But the width property doesn't work.
Does anyone know why this happens, and what the work around is? I know I could use CSS, but it's basically data in a table, and needs the <td>'s need to be a specific width.
Last edited by lelales; October 25th, 2012 at 08:52 AM.
October 26th, 2012, 01:33 AM
Originally Posted by lelales
To get a <td> element to hold it's given width you will need to specify the width attribute to 100% for the <table> element.
October 26th, 2012, 02:33 AM
You can use the following code
Then let me know with the result.
October 26th, 2012, 08:19 AM
I'll give a try later today.
Thanks so much!
Last edited by lelales; October 26th, 2012 at 08:57 AM.
October 26th, 2012, 08:53 AM
Also, if you want to use relative values you can use:
If you want a more accurate number:
You may use the number you want and decimals. See ya.
October 26th, 2012, 08:57 AM
Originally Posted by Heatleakz
Ummm...that's not true.
The following would work fine:
You just need to keep in mind a couple of simple rules.
1. Your specified td widths will not work if the sum of them all is less than (or greater than) than the specified width of the table. For example, if in the above example I told both of the TDs to be 20 pixels wide, then told the table to be 300 pixels wide--that would not add up, so it not display your specified TD widths. The standard work around for this is to have at least one TD with no specified width at all. This will cause all of the TDs with specified widths to work, and the extra will be shoved into the TD without a specified width.
2. You should style your tables with CSS.
Rather than using inline attributes for your TD widths, you should do it like this:
<table style="width: 300px;">
<td style="width: 60px;">
November 3rd, 2012, 04:35 AM
Width is a horrid and bogus tag, not recognised by xhtml.