Jump to content

Tables revisited.


sepoto
 Share

Recommended Posts

So after many postings to this forum about tables of a fixed size I have come up with this. It does work for text. It does NOT work if I add things like specifically a <textarea> which will take it upon itself to resize everything and run all over my fixed width table AS IF IT DID NOT EXIST!!!!!!! (out of breath). Is there some other style sheet type of thing that I can add to make the table more fixed and less stretchable?Thank you.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd"><html><head><title>Administation Panel:</title></head><style>   th {	  overflow: hidden;   }	  	td {	overflow: hidden;	}</style><body><table width="800px" height="250px" style="table-layout: fixed;" border="1px" cellpadding="20px" cellspacing="0px"><tr><td valign="top"><h2>Administration Panel:</h2><br><form method="post" action="writefile.php"><span>YouTube URL:</span><br><textarea name="emb" rows="5" cols="80"><?php echo $yturl; ?></textarea><br><input type="submit" name="submit" value="Update" /></form></td></tr></table></body></html>

Link to comment
Share on other sites

So after many postings to this forum about tables of a fixed size I have come up with this. It does work for text. It does NOT work if I add things like specifically a <textarea> which will take it upon itself to resize everything and run all over my fixed width table AS IF IT DID NOT EXIST!!!!!!!
sigh! Been there!actually the solution is quite simple ....just style the text area with CSSso try adding this to your styles
textarea  {	width:	200px;	height:	150px;  }

so instead of saying it is 5 rows by 80 columns (delete that from the HTML) you can give it width as noted above and height as needed.You can do that with all form elements also.....Guy

Link to comment
Share on other sites

so instead of saying it is 5 rows by 80 columns (delete that from the HTML) you can give it width as noted above and height as needed.
The "cols" and "rows" attributes are required in HTML 4.01 and XHTML 1.0You have to specify them even if you use CSS to change the size later on. Edited by Ingolme
Link to comment
Share on other sites

The "cols" and "rows" attributes are required in HTML 4.01 and XHTML 1.0You have to specify them even if you use CSS to change the size later on.
ooops..I guess the validator would have picked that up eventually.I just checked a page I wrote recently and I did have to put row/col back in on validation. How soon we forget. :) Guy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...